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
Why is color important for all objects drawn ?​
Sati [7]
Technically, drawing in colored pencil is simply layering semitransparent colors on paper to create vivid paintings. Every color has three qualities
7 0
3 years ago
Question 15 of 25
GaryK [48]
It gains purchasing power. Less money in circulation = more value.
5 0
3 years ago
Renter’s insurance is not necessary if you don’t have a lot of expensive things.
attashe74 [19]

Wrong, You should get renters insurance to insure your items that you do have or will recieve in the future are safe

7 0
3 years ago
Use the Wrap Text icon to _____. modify which graphic appears in the front of layered images modify the picture effects change t
sergey [27]

I believe it's change the way text is wrapped around an object.

3 0
3 years ago
Read 2 more answers
If a hacker can steal your passwords by installing malware that captures all the messages you type, what kind of malware did the
Free_Kalibri [48]
Keylogger, or Spyware
4 0
3 years ago
Read 2 more answers
Other questions:
  • &gt;
    6·1 answer
  • Which is true about POP3 and IMAP for incoming email?
    6·1 answer
  • BOTH INTERNATIONAL &amp; INLAND Which procedure(s) shall be used to determine risk of collision?
    14·1 answer
  • Senior executives at a global manufacturing company are determining the key performance indicators they'll use to judge how effe
    15·1 answer
  • Are computer virus and human virus the same​
    6·1 answer
  • What is the quickest way to change the format of a table?
    8·1 answer
  • If Word finds a potential error in a document, a red, green, or blue wavy underline flags the problem.
    14·1 answer
  • Why is a high-quality bond typically considered a lower-risk investment than a stock
    10·2 answers
  • What is it called when you remove some information from a file or remove a file from the disk ? A) save b) delete c) edit d) rem
    5·1 answer
  • What do you call the quality of information
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!