Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use variables to name, store, and retrieve values Use System.out.print to prompt the user for input Use a Scanner to collect user input Use math

Use variables to name, store, and retrieve values
Use System.out.print to prompt the user for input
Use a Scanner to collect user input
Use math operators to construct expression
Output to console with System.out.printf
Use format specifiers to format floating point values
Use escape sequences to include special characters in a String
2.Write a program that will collect, as input from the user, the check amount for a meal at a restaurant; and then compute and display the tip amount and the total amount to pay with each of the following tip amounts (10%,15%,20%,25%, and 30%).
Here are some examples of what the user should see when the program runs.
Example 1.
Enter the check amount : 100.00
Total with 10% tip ($10.00) is $110.00
Total with 15% tip ($15.00) is $115.00
Total with 20% tip ($20.00) is $120.00
Total with 25% tip ($25.00) is $125.00
Total with 30% tip ($30.00) is $130.00
Example 2
Enter the check amount : 47.51
Total with 10% tip ($4.75) is $52.26
Total with 15% tip ($7.13) is $54.64
Total with 20% tip ($9.50) is $57.01
Total with 25% tip ($11.88) is $59.39
Total with 30% tip ($14.25) is $61.76

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Finance The Role Of Data Analytics In Manda Due Diligence

Authors: Ps Publishing

1st Edition

B0CR6SKTQG, 979-8873324675

More Books

Students also viewed these Databases questions

Question

Why We Form Relationships Managing Relationship Dynamics?

Answered: 1 week ago