Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 11 Weeks Ago, 5 Days Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Write a program in C++ that prompts the user to input the amount of a restaurant bill (tip not included), and atip percentage, then calculates and displays the amount of the tip. we have to use Function ( this homework is from chapter function)
You are required to implement the following functions and call them in the main function:o getBillAmount(): This function takes no argument, prompts the user to input thebill amount and returns the bill amount. The function also prints the bill amount forverification.o getTipPercentage():This function takes no argument, prompts the user to inputthe tip percentage and returns the tip percentage. The function also prints the tippercentage for verification.o calcTip(): This function takes two arguments, the bill amount and the tippercentage, calculates the tip amount and returns the tip amounto printTip(): This function takes as argument the tip amount and prints it. It returnsnothing. You must use a function prototype for all the above functions The bill amount and tip amount must be displayed with a decimal point and 2 digits after thepoint The tip percentage must be displayed as a round number with no decimal point
plz help, due in 1 n half hrs
CS1336
Homework #3-1
Assigned Feb 14, due Feb 21 at 11:59 PM
This homework assignment gives you the opportunity to practice functions. HW3-1 (Graded out of 100)
Write a program that prompts the user to input the amount of a restaurant bill (tip not included), and a
tip percentage, then calculates and displays the amount of the tip. 1. Requirements – Make sure you meet all the requirements to avoid losing points To complete the assignment, you are required to use only what has been taught in class. If you
have prior programming experience, refrain from using more advanced C++ constructs, so all the
homework programs can be graded on a consistent basis.
Make sure you follow the requirements in the “Homework Notes” to avoid losing points.
You are required to implement the following functions and call them in the main function:
o getBillAmount(): This function takes no argument, prompts the user to input the
bill amount and returns the bill amount. The function also prints the bill amount for
verification.
o getTipPercentage():This function takes no argument, prompts the user to input
the tip percentage and returns the tip percentage. The function also prints the tip
percentage for verification.
o calcTip(): This function takes two arguments, the bill amount and the tip
percentage, calculates the tip amount and returns the tip amount
o printTip(): This function takes as argument the tip amount and prints it. It returns
nothing.
You must use a function prototype for all the above functions
The bill amount and tip amount must be displayed with a decimal point and 2 digits after the
point
The tip percentage must be displayed as a round number with no decimal point 2. Example Output
Below is an example output if your program is correct.