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
Pressing the Backspace key deletes the text to the of the insertion point. The left or the right?
hodyreva [135]

The answer is:

Left

The backspace key only deletes whatever way the point is pointing to. In this case, it is to the left.

Correct me if i'm wrong.  

4 0
3 years ago
Read 2 more answers
Which protocol can be used to send ipv6 packets over an ipv4 network?
Mariana [72]
There are three tunneling protocols. They are ISATAP, <span>teredo and 6TO4</span><span />
4 0
3 years ago
Which command provides the source refrence at the bottom of the current page of a document?
DENIUS [597]

Answer:

Footnote

Explanation:

The notes related to citation or reference or comment that is assigned to a text on that page is called footnote.

3 0
3 years ago
Which of the following would increase the Demand for jam?
gladu [14]
The answer would be B. An increase in the price of a complement.
8 0
3 years ago
4) Tables in HTML are the attractive way of representing information in the form of rows and WMS.
olchik [2.2K]

Answer:

1) if "<table>" is an option then that's the answer

2) <HTML>

3) <tr>

4) border-collapse collapse

5) <caption>

Explanation:

Currently studying HTML and these are the tags I'm familar with.

4 0
3 years ago
Other questions:
  • Click to review the online content. Then answer the question(s) below, using complete sentences. Scroll down to view additional
    7·1 answer
  • The ____ is a new feature in versions of microsoft office, starting with office 2007; it consists of tabs, which contain groups
    5·1 answer
  • There are about what licensed drivers here in Florida
    7·1 answer
  • To write 10 lines of code on paper:
    10·1 answer
  • Univariate linear regression Note: Solutions to this problem must follow the method described in class and the linear regression
    7·1 answer
  • 1. What are copyright laws? (6 points)
    15·1 answer
  • All of the Internet in your country disappears. What happens next?
    13·1 answer
  • When calling a function with arguments that should be modified, the __________ of those arguments are passed.
    5·1 answer
  • A plan budget time for studying and activities is referred to as?
    11·1 answer
  • PLS HURRY<br> Look at the image below
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!