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 18:30
Kto rozmawia z clamentain przez krótkofalówke w the walking dead która śledzi lee w 4 epizodzie
Answers: 1
question
Computers and Technology, 22.06.2019 20:40
Assume that there is a 4% rate of disk drive failure in a year. a. if all your computer data is stored on a hard disk drive with a copy stored on a second hard disk drive, what is the probability that during a year, you can avoid catastrophe with at least one working drive? b. if copies of all your computer data are stored on three independent hard disk drives, what is the probability that during a year, you can avoid catastrophe with at least one working drive?
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Q14 what is most important for you to choose before you build a network? a. private network b. nos c. network media d. network protocol e. directory service
Answers: 1
question
Computers and Technology, 23.06.2019 20:30
Column a of irma’s spreadsheet contains titles for each row, but her document is too big and will be printed three pages across. she wants to be sure that every page will be understood. what can irma do to with this problem?
Answers: 3
You know the right answer?
Given the following output and main function and write the class definitions for the Jedi, Master, a...
Questions
question
Mathematics, 29.04.2021 17:50
question
Mathematics, 29.04.2021 17:50
question
Mathematics, 29.04.2021 17:50
question
Mathematics, 29.04.2021 17:50
question
Mathematics, 29.04.2021 17:50
question
Mathematics, 29.04.2021 17:50
question
Chemistry, 29.04.2021 17:50
Questions on the website: 13722361