Question

In this exercise, you will complete the Restaurant Tip application from Chapter 2’s Focus on the...

In this exercise, you will complete the Restaurant Tip application from Chapter 2’s Focus on the Concepts lesson. The application’s Planning Chart is shown in Figure 3-34.

  1. Use either a flowchart or pseudocode to plan the btnCalc_Click procedure, which should calculate and display a server’s tip.
  2. Open the Tip Solution.sln file contained in the VB2017\Chap03\Tip Solution folder. Enter the three Option statements in the Code Editor window. Use the comments as a guide when coding the btnCalc_Click procedure. Be sure to use variables in your code. Display the tip with a dollar sign and two decimal places. Save the solution and then start and test the application. (If the restaurant bill and tip percentage are 56
  3. and 20, respectively, the tip is $11.20.)
  4. Now professionalize your interface by coding each text box’s TextChanged and Enter event procedures. Save the solution and then start and test the application.

Homework Answers

Answer #1

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Here a new Windows Forms Application in VB is created using Visual Studio 2017 with name "TipSolution".This application contains a form with name "Form1.vb".Below are the files associated with form1.

1.Form1.vb[Design]

2.Form1.vb

Option Strict On
Option Explicit On
Option Infer On
Public Class Form1
'Calculate button click procedure
Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click
'declaring variables
Dim restaurentBill As Double
Dim tipPercentage As Double
Dim tip As Double
'taking restaurent Bill entered by user
restaurentBill = Double.Parse(txtRestaurantBill.Text)
'taking tip percentage entered by user
tipPercentage = Double.Parse(txtTipPercentage.Text)
'calculate and display tip
tip = restaurentBill * (tipPercentage / 100)
'display tip on label
lblTip.Text = "Tip : $" & tip.ToString("0.00")
End Sub
End Class

======================================================

Output : Run application using F5 and will get the screen as shown below

Screen 1 :

Screen 2:Enter restaurant bill amount and tip percentage to calculate tip

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Know the answer?
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
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT