According to the following usage example of the class Mystery, which of the following method headers (with type contracts, without docstrings) are necessary to implement for Mystery to function as demonstrated below? Select all that apply.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter12: Points, Classes, Virtual Functions And Abstract Classes
Section: Chapter Questions
Problem 39SA
icon
Related questions
Question
According to the following usage example of the class Mystery, which of the following method headers (with type contracts, without docstrings) are necessary to implement for Pystery to function as demonstrated below? Select all that apply.
>>> m = Mystery('hello') - Mystery('world')
>>> m
<Mystery object at ex1024fc850>
>>> print (m)
hello-world
>> m.eject('Michael', 'Andi', 'Larry')
ejected
O def _init_(self):
O def _init_(self, x: str):
O def _repr_(self) -> str:
O def _str_(self) -> str:
O def _sub_(self, other: Mystery) -> str:
O def _sub_(self, other: Mystery) -> Mystery:
O def _neg_(self) -> str:
O def _dash_(self, other: Mystery) -> Mystery:
O def eject(x: str):
O def eject(x: str, y: str, z: str):
O def eject(self, x: str, y: str, z: str):
O def _neg_(self) -> Mystery:
Transcribed Image Text:According to the following usage example of the class Mystery, which of the following method headers (with type contracts, without docstrings) are necessary to implement for Pystery to function as demonstrated below? Select all that apply. >>> m = Mystery('hello') - Mystery('world') >>> m <Mystery object at ex1024fc850> >>> print (m) hello-world >> m.eject('Michael', 'Andi', 'Larry') ejected O def _init_(self): O def _init_(self, x: str): O def _repr_(self) -> str: O def _str_(self) -> str: O def _sub_(self, other: Mystery) -> str: O def _sub_(self, other: Mystery) -> Mystery: O def _neg_(self) -> str: O def _dash_(self, other: Mystery) -> Mystery: O def eject(x: str): O def eject(x: str, y: str, z: str): O def eject(self, x: str, y: str, z: str): O def _neg_(self) -> Mystery:
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Introduction to Interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning