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
A CPU has just been powered on and it immediately executes a machine code instruction. What is the most likely type of instructi
adell [148]

The most likely type of instruction that was executed by the CPU is: a jump instruction.

<h3>What is a CPU?</h3>

A central processing unit (CPU) can be defined as the main components of a computer because it acts as the brain of a computer and does all the processing and logical control.

This ultimately implies that, a central processing unit (CPU) is typically used by a computer to execute an instruction or set of instructions when powered on.

<h3>What is a jump instruction?</h3>

In Computer technology, a jump instruction specifies an offset to a new place in the program sequence when processing an instruction or set of instructions in a computer.

Read more on CPU here: brainly.com/question/5430107

3 0
2 years ago
"What technology will examine the current state of a network device before allowing it can to connect to the network and force a
slava [35]

Answer:

a network access control

3 0
3 years ago
The following function takes an array of n integers as its input and returns 1 if the array is sorted in non-decreasing order, 0
SIZIF [17.4K]

Answer:

Following is given the detailed solution to each part o question. I hope it will help you a lot!

Explanation:

5 0
2 years ago
Explain an application software​
dedylja [7]

Answer:

application software refers to the programs or series of instructions that allows us to do specific type of task on a personal computer examples word processing programs, spreadsheet programs, presentation programs among others

6 0
2 years ago
A student is recording a song on her computer. When the recording is finished, she saves a copy on her computer. The student not
denis23 [38]

Answer:

A. The song was saved using fewer bits per second than the original song.

Explanation:

A song can be recorded on the computer or any device ranging from bit rates 96 kbps to 320 kbps.  

The lesser the bitrates the lesser the quality of the audio and when we increase the bit rates, the quality of the audio recorded gradually increases.

Bitrates of 128 kbps give us a radio like quality whereas when we use bitrates of 320 kbps we get very good or CD-like quality.

According to the scenario, the most appropriate answer is option A.

3 0
3 years ago
Other questions:
  • What might be one reason why a stock becomes more valuable over time
    5·1 answer
  • What were the goals of the “paperless society” ideal?
    14·2 answers
  • A. True
    8·1 answer
  • Find the area of the regular hexagon below by using the area formula for triangles.
    7·1 answer
  • While using the CLI on a Windows 10 64-bit computer with a single HDD and a single volume, you want to move from the current dir
    15·1 answer
  • Identify the primary responsibilities associated with each of the following web design roles: content writer/editor, artist/grap
    13·1 answer
  • 120
    14·1 answer
  • if a user has one column in a table and would like to make it into two columns which command should be used
    13·1 answer
  • Which company was the first to develop personal computers?
    6·1 answer
  • Mention and discuss specific professional ethics related to augmented reality, artificial intelligence, and the internet of thin
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!