Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 1 [Student Class] Create a class called student. It should have fields for name, id and a list of tuples (course, grade) for all

image text in transcribed

Exercise 1 [Student Class] Create a class called student. It should have fields for name, id and a list of tuples (course, grade) for all courses the student has taken. Be sure to include an _init_method to initialize it with the three field values. Add a_str_method that returns a string representation of a student object in a simple way. For example, you create a student object as follows: s = Student ( 'cat', 123, [ ('comp1405', 78), ('comp1805', 87)] ) Exercise 2 [Accessing Student Data] Write a function called computeAverage(student) that takes a Student object as input and returns the average of all the courses the student has taken. If the student has not taken any courses, it returns -1

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_2

Step: 3

blur-text-image_3

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 Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

Students also viewed these Databases questions

Question

What does it mean when we say that a statistic is robust?

Answered: 1 week ago

Question

1. Identify the sources for this conflict.

Answered: 1 week ago

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago