Visual Basic Pizza Program Help! Here\'s the assignment: SmallTown Pizza Shop se
ID: 3689210 • Letter: V
Question
Visual Basic Pizza Program Help! Here's the assignment: SmallTown Pizza Shop serves just two sizes of pizza, small and large, and customers can add additional toppings if desired. Write a Visual Basic program that allows the user input their selection of a large or small pizza and the “total number of toppings” desired on their pizza. A small pizza is $6.95 including one topping and $0.65 for each additional topping A large pizza is $8.75 including one topping and $0.85 for each additional topping Also solicit the customer’s phone number. The program will calculate and display the cost. The program must have three command buttons, to calculate, to clear (reset the defaults), and to exit the application. Your GUI must use appropriate controls for accepting the input from the user. Make this application look like a program that a real pizza shop would use by including an appropriate image. Use radio buttons to choose a size and check boxes to pick the toppings. Validate a maximum of 5 toppings and validate that phone number at least looks like a real phone number (7 digits). Please answer the assignment and not post an answer to a different question
Explanation / Answer
Public Class Form1
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
End Sub
Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
RadioButton1.Checked = False
RadioButton2.Checked = False
CheckBox1.Checked = False
CheckBox2.Checked = False
CheckBox3.Checked = False
CheckBox4.Checked = False
CheckBox5.Checked = False
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim tot As Double
If RadioButton1.Checked Then
If CheckBox1.Checked Then
tot = 6.95 + 0.65
End If
If CheckBox2.Checked Then
tot = 6.95 + 0.65 * 2
End If
If CheckBox3.Checked Then
tot = 6.95 + 0.65 * 3
End If
If CheckBox4.Checked Then
tot = 6.95 + 0.65 * 4
End If
If CheckBox5.Checked Then
tot = 6.95 + 0.65 * 5
End If
End If
If RadioButton2.Checked Then
If CheckBox1.Checked Then
tot = 8.75 + 0.85
End If
If CheckBox2.Checked Then
tot = 8.75 + 0.85 * 2
End If
If CheckBox3.Checked Then
tot = 8.75 + 0.85 * 3
End If
If CheckBox4.Checked Then
tot = 8.75 + 0.85 * 4
End If
If CheckBox5.Checked Then
tot = 8.75 + 0.85 * 5
End If
End If
MsgBox("Total bill is " & tot)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
End
End Sub
End Class
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.