Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In the ChiliToGo program in Exercise 12, the costs to produce an adult meal and a childs meal are $4.35 and $3.10, respectively. Adult meals

In the ChiliToGo program in Exercise 12, the costs to produce an adult meal and a childs meal are $4.35 and $3.10, respectively. Adult meals are sold for $7 and children's meals are sold for $4. Modify the ChiliToGo program to display the total profit for each type of meal as well as the grand total profit.

image text in transcribed

Programming Exercise 2-13 ODI Instructions ChiliToGoProfit.java 1import java.util.Scanner; 2 class ChiliToGoProfit In the ChilLToGo program in Exercise hl 12, the costs to produce an adult meal public static void main(String[] args) and a child's meal are $4.35 and $3.10, // Modify the code below final double ADULT_PRICE7; 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 >> "); childMealsinput.nextInt); totaLAdult adultMeals * ADULT-PRICE; totalChild-childMeals *CHILD_ PRICE; grandTotal totalAdult totalChild; System.out.println(adultMeals" adult neals were ordered respectively. Adult meals are sold for $7 and children's meals are sold for $4 Modify the ChiliToGo program to display the total profit for each type of meal as well as the grand total profit. 9 Grading Write your Java code in the area on the right. Use the Run button to compile and run the code. Clicking the Run Checks button will run pre-configured tests against your code to calculate a grade 12 13 14 15 16 17 18 19 at ADULT_PRICEeach."); 20 21 System.out.println System.out.println(childMeals" child neals were ordered Total is "totaLAdult); Once you are happy with your results, click the Submit button to record your score at "CHILD_PRICEeach."); System.out.println System.out.println("Grand total for all meals is "+ Total is"+totalChild); 23 grandTotal); 24 25

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

Students also viewed these Databases questions