You want to create a program to enroll in classes. You've narrowed the class list down to just a few classes that computer science students might need. In your program, first the user will select a department and the program will tell them what classes are available from that department. Then the user picks a class, and the program will tell them what sections are available. After the user picks a section, the program will print a success message.
You want to create a program to enroll in classes. You've narrowed the class list down to just a few classes that computer science students might need.
In your program, first the user will select a department and the program will tell them what classes are available from that department. Then the user picks a class, and the program will tell them what sections are available. After the user picks a section, the program will print a success message.
The departments, classes and sections are as follows:
Sample run:
Select a department: (1)Computer Science (2)Math (3)Science 1 Select a class: (1)Starting Computing (2)Data Structures (3)
The user should input an integer in the range of the choices you give them. For example, a user cannot input 3 if you only present 2 choices.Ensure you are doing input validation. Your program should output Please enter a valid input. if the user inputs something they cannot and exit the program.
Example of input validation:
Select a department: (1)Computer Science (2)Math (3)Science 5 Please enter a valid input.
Make sure to submit your code on Coderunner (accessed through Canvas) as well as the final Zip file submission.
The file should be named as classRegistration.cpp.
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 4 images