Computers and Technology

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. import 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);

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 14:30, Vanesssajohn2962
Norder to receive financial aid at his vocational school, mario must fill out the fafsa. the fafsa is a form that must be completed to determine . in order to complete a fafsa, you must submit . the fafsa can students obtain
Answers: 2
image
Computers and Technology, 23.06.2019 19:30, carcon2019
Amitha writes up a one-page summary of a novel during her summer internship at a publishing company. when she reads over the page, she realizes she used the word “foreshadow” seven times, and she would like to reduce the repetition. which tool would best amitha solve this problem?
Answers: 3
image
Computers and Technology, 23.06.2019 21:00, kkpsmith
Alcohol’s affects on the cornea and lens of the eye make it more difficult
Answers: 1
image
Computers and Technology, 24.06.2019 08:00, Maxxboogie
Can someone work out the answer as it comes up in one of my computer science exams and i don't understand the cryptovariables
Answers: 1
Do you know the correct answer?
In the ChiliToGo program in Exercise 12, the costs to produce an adult meal and a child’s meal are $...

Questions in other subjects:

Konu
Computers and Technology, 07.10.2021 09:30
Konu
Mathematics, 07.10.2021 09:30
Konu
English, 07.10.2021 09:30