Ask Question
5 December, 01:21

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.

+2
Answers (1)
  1. 5 December, 01:31
    0
    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
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “If the value of age is 21 or lower, the recommendation is "vegetable juice" for steak, "cranberry juice" for trout, and "soda" for the ...” in 📗 Engineering if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers