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 04:30
Ryan is working on the layout of her web page. she needs to figure out where her header, navigation bar, text, and images should go. what technique can her?
Answers: 1
question
Computers and Technology, 22.06.2019 14:20
Cengagenowv2 is a comprehensive online learning tool. using cengagenowv2, you may access all of the following except: 2. each time you log in, cengagenowv2 automatically performs a system check and informs you if your computer does not meet the cengagenowv2 system requirements. 3. which tab/page allows you to easily track your assignment scores, number of submissions, time spent, as well as the ability view assign
Answers: 3
question
Computers and Technology, 24.06.2019 02:50
Be sure to answer all parts. synthesize the following compound from benzene. a. b. c. d. e. f. reaction [1] conditions: a b c d e f reaction [1] product: draw structure reaction [2] conditions: a b c d e f reaction [2] product: draw structure reaction [3] conditions: a b c d e f reaction [3] product:
Answers: 3
question
Computers and Technology, 24.06.2019 06:30
For which utilities, if any, does the landlord pay?
Answers: 2
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, 29.08.2021 22:50
question
German, 29.08.2021 22:50
question
Mathematics, 29.08.2021 22:50
Questions on the website: 13722359