Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Solve using c++ (urgent please) Exercise #2 (while loop and switch statement). Write a program that asks the user to choose an option from a
Solve using c++ (urgent please)
Exercise \#2 (while loop and switch statement). Write a program that asks the user to choose an option from a menu of three options: (1) increment the counter. (2) decrement the counter. (3) OR exit the program. Use A while loop to repeatedly display the menu and perform the selected action until the user chooses to exit the program by entering 3 . Use switch statement to perform the selected action based on the value of the choice variable. The program will terminate and display the final value of the count variable If the user choose to exit the program. Sample Output Eal Microseft Visual Studio Debug Console Choose an option: 1. Increment counter 2. Decrement counter 3. Exit program Enter your choice: 1 Counter has been incremented. Choose an option: 1. Increment counter 2. Decrement counter 3. Exit program Enter your choice: 2 Counter has been decremented. Choose an option: 1. Increment counter 2. Decrement counter 3. Exit program Enter your choice: 3 Exiting program. Final counter value: 1 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started