Ask Question

There is a class called Roster whose constructor takes a List of tuples with the names of students and their grades in the class, for example - - [ ('Richard', 98), ('Benny', 55), ('Katie', 87), ('Sally', 76) ].

Create an instance of the Roster class, including the following students and their respective grades, and store it in the variable mathClass: Jacob, 65 Frankie, 86 Lina, 94 Arnold, 63 Amanda, 87

+1
Answers (1)
  1. 9 June, 17:33
    0
    mathClass = Roster ([ ('Jacob', 65), ('Frankie', 86), ('Lina', 94), ('Arnold', 63), ('Amanda', 87) ])

    Explanation:

    An Instance of a class, refers to making a new object of that class. They belong to the class from which they are derived. The meaning of this is that every instance of a class that is created, will have its own set of variables with different values initialized by the constructor call, so we can make several objects of a class and define their behavior. In this question, we are asked to make a new instance of the class Roster called mathClass and at the constructor call we pass the variables of this new object as an argument.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “There is a class called Roster whose constructor takes a List of tuples with the names of students and their grades in the class, for ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers