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]
4 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]4 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
How do you take a green screen out of the video while editing?
ElenaW [278]

you should get something called  filmora you should be able to find a tutorial on how to use it

5 0
3 years ago
Explain why the control bus is not a bus.
slava [35]
Cause a control bus is a computer bus and controlled by a computer while a bus is controlled by a driver
3 0
3 years ago
Sherry’s science teacher requires the use of an open access database . Which of the following meets the requirements
cestrela7 [59]
<h2>Answer:</h2>

<u>The correct option is </u><u>(D) Google</u>

<h2>Explanation:</h2>

Open access database refers to free, unrestricted online access to research outputs such as journal articles and books. Open Access content is open to all, with no access fees. Since Google provides its services free of cost and it is open to all of the people across the world therefore it can be considered as an Open Access database.

6 0
4 years ago
MORE FREEE POINTS AYEEE
Lerok [7]

Answer:

Hehehehehe

Explanation:

6 0
3 years ago
Read 2 more answers
The ______ is the information center that drivers need to refer to when they're NOT scanning the road.
Arisa [49]

Answer:

C. instrument panel

Explanation:

In order to be able to operate your vehicle safely, you must know the functions and locations of all the interior mechanisms of your car.

The instrument panel contains gauges which include the following:

Speedometer, which indicates speed in both miles and kilometers per hour

Tachometer, which indicates rotations in the engine in revolutions per minute (RPMs)

Odometer, which indicates the total number of miles your car has been driven since it was manufactured

Fuel gauge, which shows the fuel level in your car's fuel tank

Oil gauge, which shows oil level

5 0
3 years ago
Other questions:
  • Jesse purchases a new smartphone and is immediately able to use it to send a photo over the Internet to a friend who lives in a
    12·1 answer
  • By default, text is ______aligned and values are______________aligned
    6·1 answer
  • Can you use a backup camera when you take your drivers test
    9·1 answer
  • A ____ is text and graphics that print at the bottom of every page.
    12·1 answer
  • Write the C++ if statement that compares the contents of the quanity variable to the number 10. If the quantity variable contain
    12·1 answer
  • How many four-digit personal identification numbers (PIN) are possible if the PIN cannot begin or end with a 0 and the PIN must
    6·1 answer
  • Which leader of the Jamestown colony am I?
    15·2 answers
  • At one college, the tuition for a full-time student is $6,000 per semester. It has been announced that the tuition will increase
    7·1 answer
  • What are three advantages of using enterprise software in an organization?
    10·1 answer
  • Write a python program to change variable value of your previous result percentage to your current percentage of mid-term
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!