Exercises from 4.1
Determine whether the condition is true or false. Assume a = 2 and b = 3.
- 3 * a = 2 * b
- (5 – a) * b < 7
- b <= 3
- (a * a < b) Or Not (a * a < a)
Exercises from 4.2
- Write a program to determine how much to tip the server in a restaurant. The tip should be 15% of the check, with a minimum of $1.
- A bagel shop charges 75 cents per bagel for orders of less than a half-dozen bagels and 60 cents per bagel for orders of a half-dozen or more. Write a program that requests the number of bagels ordered and displays the total cost. (Test the program for orders of four bagels and a dozen bagels.)
Exercise from 4.3
For the responses shown in the parentheses, determine the output displayed in the text box when the button is clicked on.
Private Sub btnDisplay_Click(…) Handles btnDisplay.Click
Dim age, price As Double
age = CDbl (InputBox (“What is your age?”) )
Select Case age
Case Is < 6
price = 0
Case 6 To 17
price = 3.75
Case Is >= 17
price = 5
End Select
txtOutput.Text = “The price is “ & FormatCurrency (price)
(8.5, 17)
Exercises from 4.4
Determine the effect of setting the property to the value shown.
- GroupBox1.Text = “Income”
- CheckBox1.Checked = True
- CheckBox1.Checked = False
- CheckBox1.Text = “&Vanilla”
- RadioButton1.Checked = False
- txtOutput.Text = 1stBox.Text
- RadioButton1.Text = “Clear & All”
- RadioButton1.Checked = True


0 comments