Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a class called IS310Student. It has two methods: __init__ and speak. It also has two class attributes: classNum and finalAvg. The method or constructor

image text in transcribedimage text in transcribed

Create a class called IS310Student. It has two methods: __init__ and speak. It also has two class attributes: classNum and finalAvg. The method or constructor _init__ constructs an object of IS310Student. It accepts three input parameters: aNum, name, finalScore. finalScore specifies the score on the final exam of the instance being created. The class attribute IS310Student.classNum keeps track of the number of IS310Student objects/instances created so far. IS310Student.finalAvg keeps track of the final average for all of the existing IS310Student objects. When the instance method speak() is invoked through an object, it will print out the data about that object. (100 points) Eile Edit View Navigate Code Help Project 3 | P1.py * classEx C:\Users\mokw\D. 1.py External Libraries 2 class IS310Student: classNum = 0; finalAvg = 0.0 3 4 5 def init__(self, aNum, name, finalscore): 6 7 9 10 11 12 13 def speak (self): 14 15 16 17 18 19 20 21 s1 = IS310 student ("A111", "April", 85) s1.speak() print("classNum = {0}, finalAvg = {1}". format (IS310Student.classNum, 15310Student. finalAvg) ) 32 = IS310Student ("A222", "Bill", 88) 32.speak() print("classNum = {0}, finalAvg = {1}".Format(IS310Student.classNum, IS310Student.finalAvg)) 33 = 1S310Student ("A333", "Cindy", 92) 33. speak() print("classNum = {0}, finalAvg = {1}".Format(IS310Student.classNum, IS310Student. finalAvg)) 34 = 15310Student ("A444", "Dave", 77) 34.speak() print("classNum = {0}, finalAvg = {1}".Format (15310Student.classNum, IS310Student. finalAvg)) 22 23 24 25 26 27 Run 1 My name is April and I scored 85 on the final classNum = 1, finalAvg = 85.0 My name is Bill and I scored 88 on the final classNum = 2, finalAvg = 86.5 My name is Cindy and I scored 92 on the final classNum = 3, finalAvg = 88.33333333333333 My name is Dave and I scored 77 on the final classNum = 4, finalAvg - 85.5 Process finished with exit code 0 4: Run Python Console HE

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

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions

Question

=+ Does it list exciting places to go and famous sites to see?

Answered: 1 week ago

Question

Explain exothermic and endothermic reactions with examples

Answered: 1 week ago

Question

Write a short note on rancidity and corrosiveness.

Answered: 1 week ago

Question

=+ Why do we have markets and, according to economists,

Answered: 1 week ago