View the step-by-step solution to:

Implement a program that requests a decimal value representing a restaurant bill total and an integer representing a percentage.

Implement a program that requests a decimal value representing a restaurant bill total and an integer representing a percentage. The program should compute the dollar amount of the tip and print all three values to the screen. You may assume that the user enters numbers for the two values and that the numbers are not negative.


Note that although the numbers below format as we would expect dollars and cents to format (mostly), you do not have to concern yourself with formatting to two decimal places .

>>> Enter a restaurant bill (> 0): 45.37

>>> Enter the tip percentage (e.g. 15 = 15%): 20

            The tip for a bill of $45.37 at 20% is 9.074.     

Top Answer

Sample output of the program is as follows: Enter a restaurant bill (> 0): 45.37 Enter the tip... View the full answer

Capture.PNG

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online