Ask Question
20 November, 10:31

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

+5
Answers (1)
  1. 20 November, 14:16
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers