Question

create a project for R 'n R for reading 'n Refreshment that calculates the amount due...

create a project for R 'n R for reading 'n Refreshment that calculates the amount due for individual orders and maintains accumulated totals for a summary . have a check box for takeout items, which are taxable at 8 percent all other orders are nontaxable. Include radio buttons for the five coffee selections: Cappuccino, Espresso, Latte, Iced Cappuccino, and Iced Latte. The prices for each will be assigned using these constants: Cappu----2.00 Espresso---2.25 Latte--1.75 Iced (either)---2.50.

Visual Basic

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Visual Basic Code

Public Class Form1
Dim cost1, cost2, total As Double ' Declare double variables


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' Initialize constant cost=0,total=0
cost1 = 0
total = 0

' checkboxes is true then assign cost1 value
If CheckBox1.Checked = True Then
cost1 += 3
End If

If CheckBox2.Checked = True Then
cost1 += 2
End If

If CheckBox3.Checked = True Then
cost1 += 4
End If
If CheckBox4.Checked = True Then
cost1 += 6
End If

' radiobuttons is true then assign cost2 value
If RadioButton1.Checked = True Then
cost2 = 2.0
End If

If RadioButton2.Checked = True Then
cost2 = 2.25
End If
If RadioButton3.Checked = True Then
cost2 = 1.75
End If

If RadioButton4.Checked = True Or RadioButton5.Checked = True Then
cost2 = 2.5
End If

'calculate total value
total = cost1 + (cost1 * 8 / 100) + cost2
TextBox1.Text = "$" & total 'display total cost
End Sub
End Class

OUTPUTS

Refreshments Refreshments Food Pizza Sandwich □Bread □ Cake Coffee O Iced Cappuccino Cappuccino O Expresso O Latte O Iced Latte Total Summary Calculate

Add a comment
Know the answer?
Add Answer to:
create a project for R 'n R for reading 'n Refreshment that calculates the amount due...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT