Ask Question
13 July, 05:27

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 user's 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 user's course list, display the message "Course dropped" and display the list. The loop will stop when the user enters E.

+1
Answers (1)
  1. 13 July, 07:08
    0
    The Python code will be:

    course_list = []

    decision=input ('Enter A to add course, D to drop course, and E to exit:[A/D/E]')

    decision=decision. upper ()

    while decision = = 'A':

    add_course=input ("Enter course to add:")

    add_course. upper ()

    if add_course in course_list:

    print ("You are already registered in that course")

    print ('Courses Registered:', course_list)

    else:

    course_list. append (add_course)

    print ('Course added')

    print ('Courses Registered:', course_list)

    again=input ('Enter A to add course, D to drop course, and E to exit:[A/D/E]')

    while decision = = 'D':

    del_course=input ('Enter course to drop:')

    del_course. upper ()

    if del_course in course_list:

    course_list. remove (del_course)

    print ('Course Dropped')

    print ('Courses Registered:', course_list)

    else:

    print ('You are not registered for that course')

    print ('Courses Registered:', course_list)

    again=input ('Enter A to add course, D to drop course, and E to exit:[A/D/E]')

    while decision = = 'E':

    print ('Press ENTER to EXIT')
Know the Answer?
Not Sure About the Answer?
Find an answer to your 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 ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers