subject

Assume that an int variable age has been declared and already given a value and assume that a char variable choice has been declared as well. 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 a single character (S or T or B) into choice . Then the code 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.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:50
You have just been hired as an information security engineer for a large, multi-international corporation. unfortunately, your company has suffered multiple security breaches that have threatened customers' trust in the fact that their confidential data and financial assets are private and secured. credit-card information was compromised by an attack that infiltrated the network through a vulnerable wireless connection within the organization. the other breach was an inside job where personal data was stolen because of weak access-control policies within the organization that allowed an unauthorized individual access to valuable data. your job is to develop a risk-management policy that addresses the two security breaches and how to mitigate these risks.requirementswrite a brief description of the case study. it requires two to three pages, based upon the apa style of writing. use transition words; a thesis statement; an introduction, body, and conclusion; and a reference page with at least two references. use a double-spaced, arial font, size 12.
Answers: 1
question
Computers and Technology, 23.06.2019 15:10
What role did women fill during world war ii?
Answers: 1
question
Computers and Technology, 23.06.2019 22:00
Take a critical look at three gui applications you have used—for example, a spreadsheet, a word-processing program, and a game. describe how well each conforms to the gui design guidelines listed in this chapter.
Answers: 3
question
Computers and Technology, 24.06.2019 05:50
What all vehicles has tesla inc. created over the years
Answers: 3
You know the right answer?
Assume that an int variable age has been declared and already given a value and assume that a char v...
Questions
question
Mathematics, 10.06.2020 22:57
question
English, 10.06.2020 22:57
question
Chemistry, 10.06.2020 22:57
question
Mathematics, 10.06.2020 22:57
question
English, 10.06.2020 22:57
Questions on the website: 13722363