Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA Instructions Tip Calculator Create an application that calculates three options for an appropriate tip to leave after a meal at a restaurant. Console Tip

JAVA

Instructions

Tip Calculator

Create an application that calculates three options for an appropriate tip to leave after a meal at a restaurant.

Console

Tip Calculator

Cost of meal: 52.31

15%

Tip amount: $7.85

Total amount: $60.16

20%

Tip amount: $10.46

Total amount: $62.77

25%

Tip amount: $13.08

Total amount: $65.39

Continue? (y/n): n

Specifications

The application should calculate and display the cost of tipping at 15%, 20%, and 25%.

Use rounding to make sure that all calculations are accurate.

Assume that the user will enter a valid cost for the meal.

Format the tip percent, the tip amount, and the total.

The application should continue only if the user enters y or Y to continue.

Input

A floating point number of the cost of the meal using a string prompt

Processing

Calculate the 15%, 20%, and 25% of the cost of the meal.

Calculate the total cost of the meal including tip.

Output

Print Header (tip percentage amount).

Print a line with the tip amount.

Print a line with the total cost of the meal.

Repeat for all tip percentages.

Offer user another chance to enter another meal amount or to exit.

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

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions

Question

7. Trace the rise of Magadh up to the Nandas. ( )

Answered: 1 week ago