Question

In: Computer Science

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.

Solutions

Expert Solution

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.


Related Solutions

Visual Basics In this exercise, you modify the History Grade application from this chapter’s Focus lesson....
Visual Basics In this exercise, you modify the History Grade application from this chapter’s Focus lesson. Use Windows to make a copy of the History Solution folder. Rename the copy History Solution-Functions. Open the History Solution.sln file contained in the History Solution-Functions folder. Modify the btnDisplay_Click procedure so that it uses two functions named GetGrade101 and GetGrade201 to get the appropriate grade; the procedure should then display the grade in the lblGrade control. Change the two independent Sub procedures to...
Complete the following chapter review exercise out of your textbook: Exercise 2 (a–i), p. 338 In...
Complete the following chapter review exercise out of your textbook: Exercise 2 (a–i), p. 338 In this exercise, you will practice the steps of working through a hypothesis–testing problem. You will submit a Microsoft Word document with your answers to the questions. 2. In a study of smokers who tried to quit smoking with nicotine patch therapy, 39 were smoking on year after the treatment, and 32 were not smoking one year after the treatment (based on data from “high...
According to game theory, why are you more likely to tip well at a restaurant you...
According to game theory, why are you more likely to tip well at a restaurant you frequent than at a restaurant you seldom patronize (assuming the service and food are equally comparable)?
Using Java Calculating the tip when you go to a restaurant is not difficult, but your...
Using Java Calculating the tip when you go to a restaurant is not difficult, but your restaurant wants to suggest a tip according to the service diners receive. Write a program that calculates a tip according to the diner’s satisfaction as follows: •Ask for bill amount •Ask for the diners’ satisfaction level using these ratings: 1 = Totally satisfied, 2 = Satisfied, 3 = Dissatisfied. •If the diner is totally satisfied, calculate a 20 percent tip. •If the diner is...
Business students want to predict the average customer tip from an average customer’s restaurant bill. They...
Business students want to predict the average customer tip from an average customer’s restaurant bill. They have collected data from five customers. The results are listed below: Customer Bill Tip 1 78 14.50 2 33 5.50 3 64 12 4 55 10.5 5 115 22 Develop a regression model to predict the tip amount based on the customer bill amount. B. Calculate the predicted tip (Y value), if x=82.
Chapter 6, Section 2-HT, Exercise 114 Use the t-distribution and the sample results to complete the...
Chapter 6, Section 2-HT, Exercise 114 Use the t-distribution and the sample results to complete the test of the hypotheses. Use a 5% significance level. Assume the results come from a random sample, and if the sample size is small, assume the underlying distribution is relatively normal. Test H0 : μ=15 vs Ha : μ>15 using the sample results x¯=17.2, s=6.4, with n=40. Your answer is partially correct. Try again. (a) Give the test statistic and the p-value. Round your...
This is C# programming. In Chapter 2, you created an interactive application named GreenvilleRevenue. The program...
This is C# programming. In Chapter 2, you created an interactive application named GreenvilleRevenue. The program prompts a user for the number of contestants entered in this year’s and last year’s Greenville Idol competition, and then it displays the revenue expected for this year’s competition if each contestant pays a $25 entrance fee. The programs also display a statement that compares the number of contestants each year. Now, replace that statement with one of the following messages: If the competition...
Suppose you are ordering pizza from a restaurant that is known to complete one order every...
Suppose you are ordering pizza from a restaurant that is known to complete one order every 10 minutes. Let N be a Poisson RV modeling the number of orders completed in an hour. (a) What is Λ? (b) What is the probability that fewer than (or equal to) 5 orders are completed in one hour? (c) What is the probability that between (or including) 4 to 8 orders are completed in an hour? (d) What is the probability that more...
Suppose you are ordering pizza from a restaurant that is known to complete one order every...
Suppose you are ordering pizza from a restaurant that is known to complete one order every 10 minutes. Let N be a Poisson RV modeling the number of orders completed in an hour. (a) What is Λ? (b) What is the probability that fewer than (or equal to) 5 orders are completed in one hour? (c) What is the probability that between (or including) 4 to 8 orders are completed in an hour? (d) What is the probability that more...
To complete this exercise you need a software package that allows you to generate data from...
To complete this exercise you need a software package that allows you to generate data from the uniform and normal distributions. (i) Start by generating 500 observations xi - the explanatory variable - from the uniform distribution with range [0,10]. (Most statistical packages have a command for the Uniform[0,1] distribution; just multiply those observations by 10.) What are the sample mean and sample standard deviation of the xi? (ii) Randomly generate 500 errors, ui, from the Normal[0,36] distribution. (If you...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT