Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Must be done in Python Private Data Attributes 1. id: int 2. name:string 3. address:string 4. program:string 5. current_courses:[] # Contains a list of course

Must be done in Python

Private Data Attributes

1. id: int

2. name:string

3. address:string

4. program:string

5. current_courses:[] # Contains a list of course IDs

6. completed_courses:{} # Contains a mapping from CourseID to marks obtained.

Properties:

1. name (getter only)

2. id (getter only)

3. address (getter and setter)

Derived Properties

1. average_score: Returns average score of all the completed courses. Return -1 if no courses have been completed.

Methods:

1. add_course. Takes a course id and adds to the list of current courses.

2. drop_course. Removes course id from list of courses if present, otherwise raise ValueError

3. course_completed: Takes course_id and marks_obtained and stores in the completed_courses dict if course_id in current_courses list.

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

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

Define span of management or define span of control ?

Answered: 1 week ago

Question

What is meant by formal organisation ?

Answered: 1 week ago

Question

What is meant by staff authority ?

Answered: 1 week ago

Question

Discuss the various types of policies ?

Answered: 1 week ago