Ask Question
7 April, 19:51

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. 7 April, 23:43
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers