subject

(Java) 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);

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 13:20, sanaiajohnson56
In the insert table dialog box, you select the checkbox to create the first row as the header of the table.
Answers: 3
image
Computers and Technology, 24.06.2019 13:30, yola32
What is the most important for you to choose before you build a network?
Answers: 1
image
Computers and Technology, 25.06.2019 06:10, ricksterv5000
In a game with three frames, where will the objects on layer 1 appear? a. next to the play area b. in the middle of the game behind everything else d. in front of everything else select the best answer from the choices provided
Answers: 1
image
Computers and Technology, 25.06.2019 17:30, garrettrhoad
Conrad is an architect who has just been sued because a buliding he design has collapsed and injured several people. what type of insurance would him with court costs and settlements
Answers: 3
You know the right answer?
(Java) In the ChiliToGo program in Exercise 12, the costs to produce an adult meal and a child’s mea...

Questions in other subjects:

Konu
Mathematics, 11.01.2021 15:30
Konu
Mathematics, 11.01.2021 15:30