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, 24.06.2019 01:30
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
question
Computers and Technology, 25.06.2019 05:10
Create a console project in c#. 1. create an interface "imyinterface.cs" - add a method "string imessage()" 2. create a class named "c1.cs" - add 4 private data members, create property for each data member double loanamnout=0.0; double years=0.0; double interests=0.0; double interestrate=0.0; 3. - add a constructor with parameters to assign values to loanamnout, years, interestrate with values that user entered. 4. - add one method β€œpayinterests()” to return the interests interests = loanamnout * interestrate * years 5. - inheritate "imyinterface", implement the method " imessage()", return string "be ready! ” 6. in program.cs, have users to enter loanamnout, years, interestrate. - call method payinterests() to display total interests. - call imessage() to display "be ready! ”
Answers: 3
question
Computers and Technology, 25.06.2019 10:30
How do you transfer an image onto a computer
Answers: 2
question
Computers and Technology, 25.06.2019 11:30
The main benefit of encryption of a hard drive
Answers: 1
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
History, 04.05.2021 21:20
question
Mathematics, 04.05.2021 21:20
question
Mathematics, 04.05.2021 21:20
Questions on the website: 13722361