Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Required Skills Inventory - Use variables to name, store, and retrieve values - Use System. out.print to prompt the user for input - Use a

image text in transcribed
image text in transcribed
Required Skills Inventory - 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 Problem Description and Given Info 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 105 tip ($10.00) is $110.00 Total with 151 tip ($15.00) is $115.00 Total with 201 tip ($20.00) is $120.00 Total with 254 tip ($25.00) is $125.00 Total with 30 tip ($30.00) is $130.00 Example 2 Enter the cheok anount : 47,51 Total with 100 tip {54.75} in 552.26 Total with 151 tip (57,13) is $54.64 Total with 201 tip ($9.50) to $57.01 Enter the check amount: 47.51 Total with 108 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 308 tip ($14.25) is $61.76 For the given inputs, make sure that your program output looks exactly like the examples above (including spelling, capitalization. punctuation, spaces, and decimal points). Helpful Hints: - For each percentage, first compute the tip amount, then add this amount to the check amount to get the total amount. - Remember that, because printf uses a percent sign (\%) to denote a Format Specifier, you need to use \&\% to include an actual single percent character in an output produced by print f. Need Help? Additional help resources are available by clicking on the words "Need Help?" at the bottom of this page, and search for help or ask a questionl

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

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions

Question

Explain the various techniques of Management Development.

Answered: 1 week ago