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.

Respuesta :

Explanation:

The computer program for the given case is;

int main void

{

char in;

int age;

printf ("Enter the menu code, you would like to have: S or T or B ")

scanf("%c", &in)

printf ("Kindly enter your age as well")

if (in==T or in==S or in==B)

{

   if (in==S & age <=21)

       printf(""vegetable juice")

   elseif(in==T & age <=21)

       printf("cranberry juice")

   elseif(in==B & age <=21)

      print ("Soda")

   elseif(in==S & age >21)

      printf( "cabernet")

   elseif(in==T & age >21)

      printf("chardonnay")

   else

      printf("IPA"

)

else

    printf("Invalid menu selection")

return

ACCESS MORE
EDU ACCESS
Universidad de Mexico