subject

Given the following output and main function and write the class definitions for the Jedi, Master, and Padawan class. Master and Padawan inherit from Jedi. Write the three classes and all function definitions. Jedi should have two private members : a boolean called m_isSith, and a string called m_name. It should have a constructor, a getter and setter for name, a function isSith() (the getter for m_isSith), and a void function called goToTheDarkSide(), which will set m_isSith to true and print "JEDINAME has gone to the dark side" where JEDINAME is the name of the jedi (m_name). The Master class should have one void function called specialMove that prints out a message that matches the desired output. The Padawan should have a similar function called attack, that prints out a message depending on the value of isSith. You can be creative for what the padawan says when isSith is false. /*expected output Anakin has gone to the dark side!Anakin attacks! Obi Wan jumps! Obi Wan now has the high ground. */ #include #include //Write Jedi, Master, and Padawan int main(){ Master jedi1; Padawan jedi2; jedi1.setName("Obi Wan"); jedi2.setName("Anakin"); jedi2.goToTheDarkSide(); jedi2.attack(); jedi1.specialMove(); return 0; }

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 03:30
In vista and windows 7, the appearance and personalization option allows you to change the
Answers: 1
question
Computers and Technology, 24.06.2019 09:30
What is the definition of digital literacy?
Answers: 1
question
Computers and Technology, 24.06.2019 15:30
During the software planning process, rick, a project manager, finds that his team has made an incorrect estimation of funds. what kind of risk has rick identified? rick has identified a risk.
Answers: 1
question
Computers and Technology, 24.06.2019 17:00
What are some examples of what can be changed through options available in the font dialog box? check all that apply. font family italicizing bolding pasting drop shadow cutting character spacing special symbols
Answers: 2
You know the right answer?
Given the following output and main function and write the class definitions for the Jedi, Master, a...
Questions
Questions on the website: 13722367