This is a short program to display the user with a menu. The following options s
ID: 3653305 • Letter: T
Question
This is a short program to display the user with a menu. The following options should be displayed to the user: Add to the Inventory Adjust Quantity of an Item Print Inventory Remove an Item from Inventory Quit This menu should be displayed repeatedly no matter what the user selects for an option, except 5 (quit). For now, we are not implementing the functionality for this inventory control system, therefore, whatever the user selects, it should print out to the screen the selection (if the user picks 1, you should print something like "the user chose to add to the inventory"). Theses printfs for selection should be in a switch statement. Commenting in both part 1 and part 2 is work 5 points apiece.Explanation / Answer
#include#include void main() { int choice; while(1) { clrscr(); printf(" 1.ADD to the Inventory"); printf(" 2.Adjust Qantity of an item"); printf(" 3.Print Inventory"); printf(" 4.Remove an item from nventory"); printf(" 5.Quit"); printf(" Enter your choice "); scanf("%d",&choice); switch(choice) { case 1:printf(" The user choose to ADD to the Inventory"); getch(); break; case 2:printf(" The user choose to Adjust Qantity of an item"); getch(); break; case 3:printf(" The user choose to Print Inventory"); getch(); break; case 4:printf(" The user choose to Remove an item from nventory"); getch(); break; case 5:printf(" The user choose to Quit"); getch(); exit(0); break; default:break; } } }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.