006-004-011

Menu Selection Loop with do-while

Hard

Problem Description

Menu Selection Loop with do-while

In this problem, you will create a program that reads integer inputs, outputs the corresponding action name for each, and repeats using a do-while loop until 3 is entered to exit.

Learning Objective: Understand implementing an interactive menu with do-while

Overview

Create a program using do-while that processes menu selections and repeats until exit is chosen.

Specifications

  1. No menu display needed (just accept input)
  2. Input 1: print Action: Add
  3. Input 2: print Action: Delete
  4. Input 3: print Goodbye! and exit loop
  5. Other: print Unknown option

Input Example

1
2
4
3

Output Format

Action: Add
Action: Delete
Unknown option
Goodbye!

Ready to Try Running Code?

Log in to access the code editor and execute your solutions for this problem.

Don't have an account?

Sign Up