Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Calculate the Bill, including a Tip & Tax Write a static method called calculateCost ( ) , with 4 parameters of type int, and returning

Calculate the Bill, including a Tip & Tax
Write a static method called calculateCost(), with 4 parameters of type int, and returning a String as specified below.
You method should calculate the total cost of ordering 4 different meals. The number of meals of each type will be input by the console and given to your method. Your method should add the cost of each type of meal, calculate the Meal Tax, calculate the Tip, and print the total cost.
Meal costs:
Meal 1(Steak Dinner): 45
Meal 2(Steak & Lobster Dinner): 95
Meal 3(Vegetarian Extravaganza): 30
Meal 4(Chicken Dinner): 30
Input looks like: mealCount1, mealCount2, mealCount3, mealCount4
Meal Tax is: 8%(multiply mealTotal by .08 and add it to the taxTotal)
Standard Tip is: 15%(multiply mealTotal by .15 and store in tipTotal)
Output should look like: "The total cost for this meal is $"+ n where n is the cumulative total of the meal, the tax & the tip. in java

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

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions

Question

What is QAM?

Answered: 1 week ago