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

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)?
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...
c# In Chapter 2, you created an interactive application named MarshallsRevenue. The program prompts a user...
c# In Chapter 2, you created an interactive application named MarshallsRevenue. The program prompts a user for the number of interior and exterior murals scheduled to be painted during the next month by Marshall’s Murals. Next, the programs compute the expected revenue for each type of mural when interior murals cost $500 each and exterior murals cost $750 each. The application also displays the total expected revenue and a statement that indicates whether more interior murals are scheduled than exterior...
Chapter 2 Exercise is divided in to 2 sections A and B. Data for this assignment...
Chapter 2 Exercise is divided in to 2 sections A and B. Data for this assignment is under Data files in module Ex2-30-e8.xls (for A) and Ex2-34-e8.xls (for B). See data under modules. A) The following data give the weekly amounts spent on groceries for a sample of households. $271 $363 $159 $ 76 $227 $337 $295 $319 $250 279 205 279 266 199 177 162 232 303 192 181 321 309 246 278 50 41 335 116 100 151...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT