Embercode
✕
Object-Oriented ProgrammingQuick quiz

Interfaces

6 questions. Covers Interface design.

Questions 1 to 5 of 6

  1. 1. The print_report function in Example 1 takes a TemperatureSource. What does it need from that interface?
  2. 2. The BrokenSensor example names its method read_celcius, but the base method is read_celsius. What does the override word do here?
  3. 3. Match each interface term with its meaning.

    Choose the matching item for each row.

  4. 4. Statement: when you design an interface, start from the full list of methods on the object you already have, and copy all of them into the interface.
  5. 5. In Example 3, count_lines takes only a LineReader&, not a LineWriter&. Why?

5 question(s) left on this page.