Create a page that will allow users to enter the total amount for a bill, the number of people splitting the bill, and the tip percentage that should be used. All of these values can be entered using text fields, but you may use a drop-down menu or radio buttons to allow the user to select the tip amount that they want to use. When the user clicks a button to calculate the amount it should call a function in an associated JavaScript file that will perform the calcuation. This function should have four parameters, the first which is the amount of the bill, the second of which is the tax rate, the third of which is the number of people splitting the bill, and the last of which is the desired tip rate. The function should calculate the total amount due including tax and split it evenly amongst everyone. The tip should be calculated without tax. The function should create and return a String that looks similar to the following:    "The bill of $100.00 with 8% tax comes to a total of $108.00. With 4 people splitting the bill, each person should pay $27.00 for the meal. Each person should also leave $5.00 towards the 20% tip, for a total of $33.00 per person."

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter12: Using Controls
Section: Chapter Questions
Problem 10E
icon
Related questions
Question

Create a page that will allow users to enter the total amount for a bill, the number of people splitting the bill, and the tip percentage that should be used. All of these values can be entered using text fields, but you may use a drop-down menu or radio buttons to allow the user to select the tip amount that they want to use. When the user clicks a button to calculate the amount it should call a function in an associated JavaScript file that will perform the calcuation. This function should have four parameters, the first which is the amount of the bill, the second of which is the tax rate, the third of which is the number of people splitting the bill, and the last of which is the desired tip rate. The function should calculate the total amount due including tax and split it evenly amongst everyone. The tip should be calculated without tax. The function should create and return a String that looks similar to the following: 

 

"The bill of $100.00 with 8% tax comes to a total of $108.00. With 4 people splitting the bill, each person should pay $27.00 for the meal. Each person should also leave $5.00 towards the 20% tip, for a total of $33.00 per person." 

 

Your page can use the alert function to display this message as a pop-up. Alternatively you can write it directly to page or otherwise put the information into various form components if you'd like. 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
Properties of CSS
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,