Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write your answers with your explanations. Thank you! Code Tracing class Course (object): def init (self, coursename = ', credit hrs 3, section =''):

Please write your answers with your explanations. Thank you!

image text in transcribed

Code Tracing class Course (object): def init (self, coursename = "', credit hrs 3, section =''): self.name cou r sename self.credit hrs-credit hrs self.section section def str (self) return "Name: Hours: Section: (".format (self.name, self.credit hrs, self.section) class Schedule (object): def init (self,student-''): self.student-student self.courses def str (self): return " hasclasses".format (self.student, len (self.courses)) self-courses [course. name] course if coursename in self.courses: def add_course (self, course) def remove_course (self, coursename) self.courses.pop (coursename) def credit hours (self): total int-0 or key, value in self.courses.items : total int +value.credit hrs return total int chemlCourse ("CHEM 101", 5, "1131" algebraCours "MATH 111", 3, "1111") philosophy-Course("HUM 150", 3, "1000" physics Course ("PHY 112", 4, "1101") film course ("DRA 222", 2, "3291") jeff_sched Schedule ("Jeff Winger") ieff sched.add course (chem1) jeff_sched.add_course (algebra) jeff_sched.add_course (physics) abed sched- schedule ("Abed Nadir") abed sched.add course (film) abed sched.add_course (algebra) film.credit hrs- 4 What are the values of the following? (2 Points Each ) str(chem1) str(jeff_sched) str(abed sched) jeff sched.credit_hours() - abed sched.credit hours Code Tracing class Course (object): def init (self, coursename = "', credit hrs 3, section =''): self.name cou r sename self.credit hrs-credit hrs self.section section def str (self) return "Name: Hours: Section: (".format (self.name, self.credit hrs, self.section) class Schedule (object): def init (self,student-''): self.student-student self.courses def str (self): return " hasclasses".format (self.student, len (self.courses)) self-courses [course. name] course if coursename in self.courses: def add_course (self, course) def remove_course (self, coursename) self.courses.pop (coursename) def credit hours (self): total int-0 or key, value in self.courses.items : total int +value.credit hrs return total int chemlCourse ("CHEM 101", 5, "1131" algebraCours "MATH 111", 3, "1111") philosophy-Course("HUM 150", 3, "1000" physics Course ("PHY 112", 4, "1101") film course ("DRA 222", 2, "3291") jeff_sched Schedule ("Jeff Winger") ieff sched.add course (chem1) jeff_sched.add_course (algebra) jeff_sched.add_course (physics) abed sched- schedule ("Abed Nadir") abed sched.add course (film) abed sched.add_course (algebra) film.credit hrs- 4 What are the values of the following? (2 Points Each ) str(chem1) str(jeff_sched) str(abed sched) jeff sched.credit_hours() - abed sched.credit hours

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

Oracle 11G SQL

Authors: Joan Casteel

2nd Edition

1133947360, 978-1133947363

More Books

Students also viewed these Databases questions

Question

what does sc . close ( ) ; mean?

Answered: 1 week ago

Question

6-22. New budget figures

Answered: 1 week ago