Using the knowledge of computational language in C++ it is possible to write a code that assume that an int variable age has been declared and already given a value
<h3>Writting the code:</h3>
<em>#include<stdio.h></em>
<em>#include<conio.h></em>
<em>int main()</em>
<em>{</em>
<em>//variables to rad choice and age</em>
<em>char choice;</em>
<em>int age;</em>
<em>//read age and choice</em>
<em>printf("\tEnter your age: ");</em>
<em>scanf("%d", &age);</em>
<em>//fflush the keyboard buffer before reading choice</em>
<em>fflush(stdin);</em>
<em>printf("\tEnter your choice: ");</em>
<em>scanf("%c", &choice);</em>
<em>//print the invalid message if the choice is otherthan the S,T,B</em>
<em>if(choice!='S' && choice !='T' && choice !='B')</em>
<em>{</em>
<em>printf("Invalid menu choice");</em>
<em>getch();</em>
<em>}</em>
<em>else if (age <22)</em>
<em>{</em>
<em>if (choice =='S')</em>
<em>{</em>
<em>printf("\tvegetable juice");</em>
<em>}</em>
<em>else if (choice =='T')</em>
<em>{</em>
<em>printf("\tcranberry juice");</em>
<em>}</em>
<em>else if (choice == 'B')</em>
<em>{</em>
<em>printf("\tsoda");</em>
<em>}</em>
<em>}</em>
<em>else</em>
<em>{</em>
<em>if (choice == 'S')</em>
<em>{</em>
<em>printf("\tcabernet");</em>
<em>}</em>
<em>else if (choice =='T')</em>
<em>{</em>
<em>printf("\tchardonnay");</em>
<em>}</em>
<em>else if (choice == 'B')</em>
<em>{</em>
<em>printf("\tIPA");</em>
<em>}</em>
<em>}</em>
<em>//pause the console output until user press any key on keyboard</em>
<em>getch();</em>
<em>}</em>
See more about C++ at brainly.com/question/19705654
#SPJ1