120 pointsj Fill in the blanks This exam is filled with Darkness Monsters! Put o
ID: 3705647 • Letter: 1
Question
120 pointsj Fill in the blanks This exam is filled with Darkness Monsters! Put one word in each blank to declare the Darkness Monster abstract class Darkness Monster " Requiresi nothing Modifies: number of eyes Effects: sets number of eyes to a random int in range 2-100 0i nothing " Modifies: number_of_eyes Effects: calls set number of eyes with noe Darkness Monsternt noe) Requires: nothing * Modifies: nothing : returns number_ of_eyes athemM Molint get_number_of_eyes() Requires: nothing *Modifies: number of eyes Effects: sets number_of eyes to noe if noe is in range 2-100 otherwise sets number_of_eyes to 100 rtusl Viaot virtual string scar t set_number_of_eyes(int noe) Ipure virtual method to return a scary string virtual string scare) -0 protected: int number_of_eyes;Explanation / Answer
1. Class
This is the class declaration.
2. Public
In abstract classes we always need to use public specifier only becuase it need to be implemented by other class,
3. void num_of_eyes();
Here it is method declaration
4. Public
5.int
Here the parameter type should be defined inside the method declaration.
6. public
7. public, throws execption;
8. void
virtual functions generally don't return anything so void should be given
9. Pure
For every abstract class there can be pure virtual function defined as =0
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.