1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
leonid [27]
3 years ago
14

Assume that an int variable age has been given a value. Assume further that the user has just been presented with the following

menu: S: hangar steak, red potatoes, asparagus T: whole trout, long rice, brussel sprouts B: cheddar cheeseburger, steak fries, cole slaw (Yes, this menu really IS a menu!) Write some code that reads the string (S or T or B) that the user types in into a variable choice and prints out a recommended accompanying drink as follows: if the value of age is 21 or lower, the recommendation is "vegetable juice" for steak, "cranberry juice" for trout, and "soda" for the burger. Otherwise, the recommendations are "cabernet", "chardonnay", and "IPA" for steak, trout, and burger respectively. Regardless of the value of age, your code should print "invalid menu selection" if the character read into choice was not S or T or B.
Computers and Technology
1 answer:
jeka57 [31]3 years ago
5 0

Answer:

No programming language stated.

I'll answer the question using C++ programming language

Explanation:

The code goes this;

.#include <iostream>

using namespace std;

int main()

{

string order; int age;

cout<<"Press S for hangar steak, red potatoes, asparagus"<<endl;

cout<<"Press T for whole trout, long rice, brussel sprouts"<<endl;

cout<<"Press B for cheddar cheeseburger, steak fries, cole slaw"<<endl;

cout<<"Please make your order";

cin>>order;

cout<<"Please what's your age";

cin>>age;

if(order == "S" || order == "T" || order == "B")

{

if(age <= 21)

{

if(order == "S")

{

cout<<"The Recommendation is Vegetable Juice";

}

else if(order == "T")

{

cout<<"The Recommendation is Cranberry Juice";

}

else if(order == "B")

{

cout<<"The Recommendation is Soda";

}

}

else

{

if(order == "S")

{

cout<<"The Recommendation is Cabernet";

}

else if(order == "T")

{

cout<<"The Recommendation is Chardonnay";

}

else if(order == "B")

{

cout<<"The Recommendation is IPA";

}

}

}

else

{

cout<<"Invalid Menu Selection";

}

return 0;

}

You might be interested in
Tạo biến
rewona [7]

Answer:

WHERE ARE YOU FROM

Explanation:

TRANSLATE IT TO ENGLISH

5 0
3 years ago
Ninety-two percent of the new information was stored on magnetic media, mostly in _____.
kiruha [24]

Answer:

The answer to the following question is the option "b".

Explanation:

In the computer system, Hard disks stand for the hard disk drive. It is also known as a hard disk. It locates inside the computer case. The hard disk drive is used to store an electromechanical data. That uses magnetic storage device that store and retrieve data. So the answer to this question is hard disks.

5 0
3 years ago
How can you tell the value of a purchase?
ZanzabumX [31]
Look at the price tag
find the item on ebay to see what other are selling it for


8 0
2 years ago
How can websites illustrate cooperation and kindness?
USPshnik [31]
By being willing to communicate and troubleshoot.
7 0
2 years ago
Read 2 more answers
What is activated as necessary to support local eocs and to ensure that responders have the resources they need to conduct respo
gizmo_the_mogwai [7]

Answer: Emergency Operation Center (EOC)

Explanation:

An Emergency Operation Center is the coordination base for emergency service in case there is any within a state or a state Connecticut. The major purpose of the emergency center is to be in charge of controlling deploying and utilizing facilities needed to prepare for any form of emergency, disaster management, etc.

To run an effective Emergency Operation Center, focus must be on the facilities, equipments and personnel involved.

3 0
3 years ago
Other questions:
  • Who is the last person appointed to the u.s supreme court
    11·1 answer
  • In a @return tag statement the description:
    13·2 answers
  • What is hyper transport
    10·1 answer
  • All states that have altered judicial selection techniques in recent years have adopted some form of:
    5·1 answer
  • You are asked to monitor a network which has a network monitoring system. Using the monitoring server, you notice that it is lis
    13·1 answer
  • A ________ is a single media file including art, sound, animation, or movies.
    9·1 answer
  • Why would it be hard to find the ideal CO2 level if the light intensity were very low?
    9·1 answer
  • Does -8 = -21?<br>[this is NOT a trick question]<br>Yes....?<br>No!​
    12·2 answers
  • Choose all that apply.
    11·1 answer
  • A(n) ________ address is the address that external entities use when communicating with your network.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!