Ask Question
6 August, 05:00

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.

+5
Answers (1)
  1. 6 August, 08:19
    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 you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers