1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
avanturin [10]
3 years ago
8

Create a class called IS310Student. It has two methods: __init__ and speak. It also has two class attributes: classNum and final

Avg. The method or constructor __init__ constructs an object of IS310Student. It accepts three input parameters: aNum, name, finalScore. finalScore specifies the score onthe final exam of the instance being created. The class attribute IS310Student.classNum keeps track of the number of IS310Studentobjects/instances created so far. IS310Student.finalAvgkeeps track of the final average for all of the existing IS310Studentobjects.When the instance method speak() is invoked through an object, it will print out the data about that object. (100 points)
Computers and Technology
1 answer:
Irina-Kira [14]3 years ago
3 0

Answer:

class IS310Student:

 classNum = 0

 finalAvg = 0.0

 def __init__(self, aNum, name, finalScore):

   self._aNum = aNum

   self._name = name

   self._finalScore = finalScore

   IS310Student.finalAvg = ((IS310Student.finalAvg*IS310Student.classNum) + \  finalScore)/(IS310Student.classNum+1)

   IS310Student.classNum = IS310Student.classNum + 1

 def speak(self):

   print('My name is %s and I scored %d on the final'%(self._name, self._finalScore))

s1 = IS310Student("C23", "Mike", 73)

s1.speak()

print("classNum = {0}, finalAvg = {1}".format(IS310Student.classNum, \

                                             IS310Student.finalAvg))

s2 = IS310Student("C24", "Matt", 79)

s2.speak()

print("classNum = {0}, finalAvg = {1}".format(IS310Student.classNum, \

                                             IS310Student.finalAvg))

s3 = IS310Student("C25", "Jeff", 74)

s3.speak()

print("classNum = {0}, finalAvg = {1}".format(IS310Student.classNum, \

                                             IS310Student.finalAvg))

s4 = IS310Student("C26", "Colt", 87)

s4.speak()

print("classNum = {0}, finalAvg = {1}".format(IS310Student.classNum, \

                                             IS310Student.finalAvg))

Explanation:

  • Initialize the variables and set the aNum, name, finalScore variables in the constructor.
  • Initialize an object for IS310Student class and pass the values as an argument to the constructor.
  • Call the speak method using the object of IS310Student class.
  • Display the value of final average.
You might be interested in
Question 5
OverLord2011 [107]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

This is a Python function that generates random number between the given range. However, it includes the numbers that are given in the range.

So this function can generate a random number and return a number between 1 and 9 (inclusive 1 and 9).

The function is written below

...........................................................................................................

import random

print(random.randint(1, 9))

<em>#returns a number between 1 and 9 (both included)</em>

.....................................................................................................................

4 0
3 years ago
Please help I’ll give 10 points
yaroslaw [1]

Answer: Do

Explanation:

5 0
3 years ago
What is constructive criticism?
Mumz [18]

Answer:

Constructive cristsism is a helpful way of giving feedback that provides specific, actionable suggestions. Or, its a nice way of criticizing someone and telling them what to do better

4 0
3 years ago
The merge sort algorithm____________.A. Can be used only on vectors of even length.B. Works by reducing vectors down to the base
V125BC [204]

Answer:

C. Works by merging two sorted vectors into one larger sorted vector

Explanation:

Merge sort is an efficient, general-purpose, comparison-based sorting algorithm.

Merge sort repeatedly breaks down a list into several sub-lists until each sublist consists of a single element and <em>merging</em> those sub-lists in a manner that results into a sorted list.

8 0
3 years ago
How do you copy a file​
trasher [3.6K]

Answer:

right click and press control c

8 0
3 years ago
Other questions:
  • What is the role of the constructor for an object?
    5·1 answer
  • Sarah, a computer user, tells James, a computer technician, that the network she is connected to is running too slowly. Which of
    5·1 answer
  • The show ip dhcp binding command displays _____. (Points : 5) the MAC table cache information
    7·1 answer
  • Window frame will expand to fill the entire desktop when you
    12·1 answer
  • Why use LinkedIn automation for LinkedIn?
    10·1 answer
  • Wearables, video playback and tracking devices can help athletes because
    15·1 answer
  • Who is the best valorant character
    11·2 answers
  • In what way, if any, are problems related to conflicts? Problems and conflicts are the same thing. Problems and conflicts are th
    9·1 answer
  • Write a program that first reads a list of 5 integers from input. Then, read another value from the input, and output all intege
    5·2 answers
  • A parent process calling _____ system call will be suspended until children processes terminate.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!