1) Given the following completed class header: first, find all the errors, then state why the error exists, and finally provide a new line of code that will correct the error. Not all errors are syntax errors, some may be flawed implementation choices and thus would later become logical flaws and errors during actual class implementation. If a line has multiple errors, please use two boxes to state the error line and reason, but your new code may be the same in both boxes. You may or may not use all the provided error boxes. 1. PurplePeopleEater { 2. public: int eyeCount; Color monsterColor; bool horn; int peopleEaten; 9. private: 10. 11. 12. 3. 4. bool PurplePeopleEater::hasHorn(); void getEyeCount(); void setcolor(string); void consumePerson(); 5. 6. 13. 7. 14. // continues to the right 15. }; 8. Line #: Why does this line have an error?

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question
1) Given the following completed class header: first, find all the errors, then state why the error exists, and finally
provide a new line of code that will correct the error. Not allerrors are syntax errors, some may be flawed
implementation choices and thus would later become logical flaws and errors during actual class implementation.
If a line has multiple errors, please use two boxes to state the error line and reason, but your new code may be the
same in both boxes. You may or may not use all the provided error boxes.
1. PurplePeopleEater {
2. public:
9. private:
int eyeCount;
Color monsterColor;
bool horn;
3.
10.
bool PurplePeopleEater::hasHorn();
void getEyeCount();
void setcolor(string);
void consumePerson();
4.
11.
5.
12.
6.
int peopleEaten;
13.
7.
14.
// continues to the right
15. };
8.
Line #: Why does this line have an error?
New code to put on the specified line:
Line #: Why does this line have an error?
New code to put on the specified line:
Line #: Why does this line have an error?
New code to put on the specified line:
Line #: Why does this line have an error?
New code to put on the specified line:
Transcribed Image Text:1) Given the following completed class header: first, find all the errors, then state why the error exists, and finally provide a new line of code that will correct the error. Not allerrors are syntax errors, some may be flawed implementation choices and thus would later become logical flaws and errors during actual class implementation. If a line has multiple errors, please use two boxes to state the error line and reason, but your new code may be the same in both boxes. You may or may not use all the provided error boxes. 1. PurplePeopleEater { 2. public: 9. private: int eyeCount; Color monsterColor; bool horn; 3. 10. bool PurplePeopleEater::hasHorn(); void getEyeCount(); void setcolor(string); void consumePerson(); 4. 11. 5. 12. 6. int peopleEaten; 13. 7. 14. // continues to the right 15. }; 8. Line #: Why does this line have an error? New code to put on the specified line: Line #: Why does this line have an error? New code to put on the specified line: Line #: Why does this line have an error? New code to put on the specified line: Line #: Why does this line have an error? New code to put on the specified line:
Answer spaces for question 1 continued:
Line #: Why does this line have an error?
New code to put on the specified line:
Line #: Why does this line have an error?
New code to put on the specified line:
Line #: Why does this line have an error?
New code to put on the specified line:
Line #: Why does this line have an error?
New code to put on the specified line:
Line #: Why does this line have an error?
New code to put on the specified line:
Line #: Why does this line have an error?
New code to put on the specified line:
Transcribed Image Text:Answer spaces for question 1 continued: Line #: Why does this line have an error? New code to put on the specified line: Line #: Why does this line have an error? New code to put on the specified line: Line #: Why does this line have an error? New code to put on the specified line: Line #: Why does this line have an error? New code to put on the specified line: Line #: Why does this line have an error? New code to put on the specified line: Line #: Why does this line have an error? New code to put on the specified line:
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Data members
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