Question: Hi there, I am trying to code this program in C and I am not able to get it to work for my homework. I
Hi there, I am trying to code this program in C and I am not able to get it to work for my homework. I feel like Ive tried everything, I will for sure thumbs up if you can help me figure out what is wrong. Here is the problem as well as what I have:

Here is the error and suggestions to fix:

Thank you!
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. SUBMIT X 60 of 60: 2022-01-16 02:45:16 - W - 1 scanf("%c",&choice); 12 3 if (age 21 && choice == 'S') 13 printf("cabernet"); 14 else 15 if (age > 21 && choice == 'T') 16 printf("chardonnay"); 17 else 18 if (age > 21 && choice == 'B'); 19 printf ("IPA"); 20 21 else 22 printf("invalid menu selection"); CODELAB ANALYSIS: COMPILER ERROR(S) Print Content Results Support More Hints: We think you might want to consider using: {} V COMPILER ERROR MESSAGES CTest.c: In function 'main': ': CTest.c:25:10: error: 'else' without a previous 'if' else 1 #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
