Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions

Question

Communicate goals and results.

Answered: 1 week ago

Question

=+to live and work wherever he or she wants?

Answered: 1 week ago

Question

=+How will this affect the recruiting process?

Answered: 1 week ago