October 8, 2009. 1.Open VB. 2.Create the following form:

5
More Mathematical Operators Bake Sale Program October 8, 2009

Transcript of October 8, 2009. 1.Open VB. 2.Create the following form:

Page 1: October 8, 2009. 1.Open VB. 2.Create the following form:

More Mathematical OperatorsBake Sale Program

October 8, 2009

Page 2: October 8, 2009. 1.Open VB. 2.Create the following form:

1. Open VB.2. Create the

following form:

Page 3: October 8, 2009. 1.Open VB. 2.Create the following form:

Double click the Calculate button and enter the following code:

'Calculate Total Sales lblTotalSales.Caption =

Val(txtCookies.Text) _ + Val(txtCakes.Text) + Val(txtPies.Text)

+ _ Val(txtMuffins.Text)

Page 4: October 8, 2009. 1.Open VB. 2.Create the following form:

'Calculate Sales Percentages lblCookiesPerc.Caption =

Fix(Val(txtCookies.Text) / _ Val(lblTotalSales.Caption) * 100) lblCakesPerc.Caption =

Fix(Val(txtCakes.Text) / _ Val(lblTotalSales.Caption) * 100) lblPiesPerc.Caption = Fix(Val(txtPies.Text) /

_ Val(lblTotalSales.Caption) * 100) lblMuffinsPerc.Caption =

Fix(Val(txtMuffins.Text) / _ Val(lblTotalSales.Caption) * 100)

Page 5: October 8, 2009. 1.Open VB. 2.Create the following form:

Save your work!Run your program.....does it work?I’ll walk around to check and give you credit.

Have a great weekend! 3 day weekend.........