subject

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: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:40
Adna sequence encoding a five-amino acid polypeptide is given below. …… …… locate the sequence encoding the five amino acids of the polypeptide, and identify the template and coding strand.
Answers: 1
question
Computers and Technology, 21.06.2019 20:40
Convert and simplify the following sentences to conjunctive normal form (cnf): (a) (p → (q → r)) → (p → (r → q)) (b) (p ∧ q) → (¬p ↔ q) (c) ((p → q) ∧ ¬q) → ¬p
Answers: 3
question
Computers and Technology, 24.06.2019 23:30
Does anyone have the problem where you try to watch a video to get your answer but it brings up a thing asking your gender to make ads relevant but it doesn't load? btw i won't be able to see the answer so use the comments .
Answers: 1
question
Computers and Technology, 25.06.2019 02:00
Software and services are used to conceive, plan, and execute projects in any field. these tools are excellent methods of increasing the probability of successful projects. open source linux project management mind-mapping
Answers: 2
You know the right answer?
In the ChiliToGo program in Exercise 12, the costs to produce an adult meal and a child’s meal are $...
Questions
question
Mathematics, 18.04.2020 00:01
question
Mathematics, 18.04.2020 00:01
question
Mathematics, 18.04.2020 00:01
question
Geography, 18.04.2020 00:01
Questions on the website: 13722363