Question
Write a program for course registration. Students can use this program to add and drop courses. There should be a loop in the program that
Write a program for course registration. Students can use this program to add and drop courses. There should be a loop in the program that tells the user to enter A to add course, D to drop course or E to exit. If A is chosen, ask the user to enter the course to add. If the user is already registered in that course, display the message You are already registered in that course; otherwise, add the course to the users course list, display the message Course added, sort the list and display the list. If the user chooses D, ask the user to enter the course to drop. If the user is not registered in that course, display the message You are not registered in that course; otherwise, remove the course from the users course list, display the message Course dropped and display the list. The loop will stop when the user enters E.
The following is an example:
Enter A to add course, D to drop course, and E to exit: A
Enter course to add: CSC151
Course added
Courses registered: ['CSC151']
Enter A to add course, D to drop course, and E to exit: A
Enter course to add: CSC134
Course added
Courses registered: ['CSC134', 'CSC151']
Enter A to add course, D to drop course, and E to exit: A
Enter course to add: CSC139
Course added
Courses registered: ['CSC134', 'CSC139', 'CSC151']
Enter A to add course, D to drop course, and E to exit: D
Enter course to drop: CSC134
Course dropped
Courses registered: ['CSC139', 'CSC151']
Enter A to add course, D to drop course, and E to exit: A
Enter course to add: CSC151
You are already registered in that course
Enter A to add course, D to drop course, and E to exit: A
Enter course to add: CSC121
Course added
Courses registered: ['CSC121', 'CSC139', 'CSC151']
Enter A to add course, D to drop course, and E to exit: E
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