Answered step by step
Verified Expert Solution
Link Copied!

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:

image text in transcribed

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 details 
Main 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

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

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

More Books

Students also viewed these Databases questions

Question

I am having trouble with calculating the NPV for a project

Answered: 1 week ago

Question

Define Decision making

Answered: 1 week ago

Question

What are the major social responsibilities of business managers ?

Answered: 1 week ago

Question

What are the skills of management ?

Answered: 1 week ago

Question

2. Describe why we form relationships

Answered: 1 week ago

Question

5. Outline the predictable stages of most relationships

Answered: 1 week ago