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
TEA [102]
3 years ago
9

Assume that an int variable age has been declared and already given a value and assume that a char variable choice has been decl

ared 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.
Computers and Technology
1 answer:
vampirchik [111]3 years ago
8 0

Answer:

#include <iostream>

using namespace std;

int main()

{

   int age = 28;

   char menu_selection;

   cout << "Choose an item (S, T, or B) on the menu: ";

   

   cin >> menu_selection;

   

   if (menu_selection == 'S'){

       if (age <= 21){

           cout<<"Recommendation is vegetable juice";

       }

       else{

           cout<<"Recommendation is cabernet";

       }

   }

   else if (menu_selection == 'T'){

       if (age <= 21){

           cout<<"Recommendation is cranberry juice";

       }

       else{

           cout<<"Recommendation is chardonnay";

       }

   }

   else if (menu_selection == 'B'){

       if (age <= 21){

           cout<<"Recommendation is soda";

       }

       else{

           cout<<"Recommendation is IPA";

       }

   }

   else{

       cout<<"Invalid menu selection";

   }

   

   return 0;

}

Explanation:

Here is your solution in C++.

Initialize <em>age</em>, declare <em>menu selection</em>, and ask the user to make their choice.

Then check for each condition using if-else structure. <u>Depending on the user choice</u> and <u>value of the age</u>, print the recommendation.

You might be interested in
Which program assesses and measures improper medicare fee-for-service payments (based on reviewing selected claims and associate
jok3333 [9.3K]

Established the Payment Error Rate Measurement (PERM) program to measure improper payments in the Medicaid program and the States Children's Health Insurance Program (SCHIP)

<h3>What is the Impact of Improper Payments Information Act (IPIA) ?</h3>

The IPIA mandates that agencies adhere to a variety of methodological parameters for computing mistake rates and improper payment estimates in order to achieve consistency in improper payment reporting across federal agencies. When reporting erroneous payment amounts and rates, one obligation is to use gross values. By combining underpayments and overpayments, a gross erroneous payment amount is determined. For consistency, historical figures that were initially provided as net numbers have been converted to gross numbers unless otherwise noted. Denied claims must also be included in the sample, according to the IPIA. For both the May and November reports, the CERT program includes rejected claims in its sample. Only the November report's findings were refuted by the HPMP samples. As a result, calculations for this May report used HPMP denied claims data from the November 2007 report.

To learn more about States Children's Health Insurance Program (SCHIP) , Visit:

<u>brainly.com/question/13034065</u>

#SPJ4

5 0
1 year ago
Which three of the following statements are true about using a WYSIWYG editor?
lubasha [3.4K]

Answer:

3

Explanation:

3 0
3 years ago
Read 2 more answers
Question #1
trasher [3.6K]
The answers is 25 because it is 25 due to the GB
4 0
3 years ago
Read 2 more answers
if we had a set of 10 constraints and solver had to deterimine which 4 to enforce what would be the binary indicator varibales h
Inessa [10]

Answer:

if we had a set of 10 constraints and solver had to determine which 4 to enforce what would be the binary indicator variables have to  sum to make this happen

answer : 6

Explanation:

number of constraints = 10

solver has to determine which 4 to enforce

Hence the number the Binary indicator will have to sum to enforce 4

will be : (number of constraints) - 4

              = 10 - 4 = 6

5 0
3 years ago
The non-conditional boolean logical and operator is written as ____.
bixtya [17]
False because whhy would it be true. words of logic

3 0
3 years ago
Other questions:
  • Which data table display compares report metrics to the website average?
    6·1 answer
  • Given an integer variable i and a floating-point variable f, write a statement that writes both of their values to standard outp
    12·1 answer
  • True or false there is no relationship between the purpose of the page and the page quality
    13·1 answer
  • Which command should you select to track changes in a document?
    9·2 answers
  • अस्स्मन्चचरे ------------------- दृश्यते |
    8·1 answer
  • Seeing her Daughter graduate from college is most likely a short term goal for a person of which of these ages ? A) 24 years old
    10·1 answer
  • Which of the following statement is true? Single choice. (2 Points) Views are virtual tables that are compiled at run time All o
    12·1 answer
  • Help me guys plssssss​
    10·1 answer
  • Is social media bringing people together or cause in sepretation?​
    11·2 answers
  • Discuss the factors which cause imbalance in the environment.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!