Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ramming Exercise 2-13 Instructions ChiliToGoProfit.java+ 1 import java.util.Scanner 2 class ChiliToGoProfit In the chiliToGo program in Exercise 12, the costs to produce an adult meal
ramming Exercise 2-13 Instructions ChiliToGoProfit.java+ 1 import java.util.Scanner 2 class ChiliToGoProfit 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 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. 4 public static void main(String] args) [ // 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(Syste -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 (adultMealsadult meals were ordered at ADULT PRICE 8 10 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 Once you are happy with your results, click the Submit button to record your score each System.out.println(" Systen.out.println(childMealschild meals were ordered at "CHILD_PRICE 20 Total istotalAdult); 21 each": Systen.out.println(" System.out.println( "Grand total for all meals is "grandTotal); Total is +totalChild); 23 24 25 26
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started