GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

Which group of classes is poorly designed?

Which group of classes is poorly designed?

Read Details

What object oriented programming concept can often be used t…

What object oriented programming concept can often be used to eliminate explicit type tests?

Read Details

Consider the following code snippet: anEmployee = Programme…

Consider the following code snippet: anEmployee = Programmer() anEmployee.increaseSalary(2500) If the Programmer class inherits from the Employee class, and both classes have an implementation of the increaseSalary method with the same set of parameters, which statement is correct?

Read Details

What would be the inhertiance relationships between classes…

What would be the inhertiance relationships between classes Apples, Pears, and Fruit?

Read Details

If a method in a subclass carries out the action of the supe…

If a method in a subclass carries out the action of the superclass method and also does some additional work then the method in the subclass is said to ____________________ the functionality of the superclass method.

Read Details

Consider the following code segment: class Fruit: def __in…

Consider the following code segment: class Fruit: def __init__(self, name: str) -> None : . . . class Apple : def __init__self(self, name: str) -> None : . . . Which statement successfully creates a new Apple object?

Read Details

Identify the subclass and superclass in the following code s…

Identify the subclass and superclass in the following code segment: class ChoiceQuestion(Question) : def __init__(self) -> None : . . .

Read Details

Consider the following code segment: class Employee : def _…

Consider the following code segment: class Employee : def __init__(self, name: str) -> None: . . . def getSalary(self) : . . . . . . class Programmer(Employee) : def __init__(self, name: str) -> None: . . . def writeProgram(self) : . . . Which of the following code segments is not legal?

Read Details

Consider the following task hierarchy — representing some u…

Consider the following task hierarchy — representing some unit of work to be completed. class Task:    def __init__(self, label: str) -> None:        self._label = label     def cost(self) -> int:        raise NotImplementedError(“bad”) class FixedTask(Task):    def __init__(self, label: str, minutes: int) -> None:        super().__init__(label)        self._minutes = minutes     def cost(self) -> int:        return self._minutes * 2     def __repr__(self) -> str:        return f”FixedTask(label={self._label}, cost={self.cost()})” def main() -> None:    items: list[Task] = [ FixedTask(“x”, 10), FixedTask(“y”, 3) ]    for t in items:        print(t) main() What prints?

Read Details

Consider the following code snippet: aVehicle = Auto() aVeh…

Consider the following code snippet: aVehicle = Auto() aVehicle.moveForward(200) If the Auto class inherits from the Vehicle class, and both classes have an implementation of the moveForward method with the same set of parameters, which statement is correct?

Read Details

Posts pagination

Newer posts 1 … 72 73 74 75 76 … 79,103 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top