Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please code in JAVA In the ChiliToGo program in Exercise 12, the costs to produce an adult meal and a child's meal are $4.35 and

Please code in JAVA

image text in transcribedimage text in transcribed

In the ChiliToGo program in Exercise 12, the costs to produce an adult meal and a child's meal are $4.35 and $3.10, respectively. Adult meals are sold for $7.00 and children's meals are sold for $4.00. Modify the ChiliTogo program to display the total profit for each type of meal as well as the grand total profit. An example of the program is shown below: Enter number of adult meals ordered >> 10 Enter number of child meals ordered >> 5 10 adult meals were ordered at 7.0 each. Total is 70.0 5 child meals were ordered at 4.0 each. Total is 20.0 Grand total for all meals is 90.0 Profits: Adult profit is 26.5 Child profit is 4.5 Total profit is 31.0 mport java.util.Scanner; class ChiliToGoProfit { public static void main(String[] args) { // Modify the code below final double ADULT_PRICE = 7; final double CHILD_PRICE = 4; int adultMeals; int childMeals; double totalAdult, totalChild, grandTotal; Scanner input = new Scanner(System.in); System.out.print("Enter number of adult meals ordered >> "); adultMeals = input.nextInt(); System.out.print("Enter number of child meals ordered >> "); childMeals = input.nextInt(); totalAdult = adultmeals * ADULT_PRICE; totalChild = childMeals * CHILD_PRICE; grandTotal = totalAdult + totalChild; System.out.println(adultMeals + " adult meals were ordered at ADULT_PRICE + " each."); System.out.println(" Total is " + totalAdult); System.out.println(childMeals + child meals were ordered at CHILD_PRICE + " each."); System.out.println(". Total is " + totalChild); System.out.println("Grand total for all meals is " + grandTotal); 11 + +

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

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago