Date: Thursday, January 29, 2004.
Ex. 1.
- Input a real number representing the amount in dollars that a
customer receives as the check in a restaurant.
- Then the program should ask the user if the service was good, and
read his answer in a character as a 'y' or a 'n'.
- If the answer is 'y', the program must compute the tip as 20% of
the amount, otherwise as 15%. Compute the total amount to be paid and
output the result.
- Declare the percentages (15 and 20) as constants.
- Can you compute the result so that it has only 2 decimals
(representing the cents)?
Ex. 2. Once the program is working, execute it step by step
using the debugger.
Send me: Source file with an example of program execution as
a comment.