Answered step by step
Verified Expert Solution
Question
1 Approved Answer
How do I make the main file to run all of these tests I have this right now class Course: def __init__(self, course_id: str, crn:
How do I make the main file to run all of these tests
I have this right now
class Course: def __init__(self, course_id: str, crn: int, school: str, program: str): self._course_id = course_id self._crn = crn self._school = school self._program = program self._class_list = [] def add_student(self, student_id: str): if student_id not in self._class_list: self._class_list.append(student_id) def remove_student(self, student_id: str): if student_id in self._class_list: self._class_list.remove(student_id) def is_enrollment(self, student_id: str): if student_id in self._class_list: return True def is_class(self): info = "{} - {}".format(self._course_id, self._crn) return info def details(self): details = "{} {} is in the {} in the {} with the following students: {}".format(self._course_id,self._crn,self._course_id,self._school,self._class_list) return detailsMain program that tests the Course class as follows: Test 1: Start by printing the string "--> Test 1:" on a line by itself. Create an instance of the Course class for ACIT2515: Add in at least three students to the course (including your own student ID). o Remove your student Id from the course. o Check if you are enrolled in ACIT2515. If you are not, print I should be enrolled in ACIT2515 - 72388!". Hint: get the name and crn with the method you created in Course o Print the course details. Test 2: Start by printing the string "--> Test 2:" on a line by itself. Creates an instance of the Course class for another of your courses: o Add in at least five students (including your own student ID). o Remove all but 2 students (note: keep yourself in the course). o Try to add your student ID a second time. o Print the course details (note: your student ID should only appear once in the list of students). Test 3: Start by printing the string"--> Test 3:" on a line by itself. Creates an instance of the Course class for another of your courses: o Do NOT add any students to this course. Print the course details (note: the list of students should be displayed as None)
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