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, 22.06.2019 06:30
Selective incapacitation is a strategy to reduce prison population
Answers: 3
question
Computers and Technology, 22.06.2019 11:30
Awell-diversified portfolio needs about 20-25 stocks from different categories.
Answers: 2
question
Computers and Technology, 22.06.2019 21:10
Dameas communication challenge is due to which factor
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Plz ( which is an example of a good url?
Answers: 1
You know the right answer?
Given the following output and main function and write the class definitions for the Jedi, Master, a...
Questions
question
Social Studies, 05.05.2020 09:17
question
Mathematics, 05.05.2020 09:17
question
Mathematics, 05.05.2020 09:17
Questions on the website: 13722363