Computers and Technology

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; }

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:00, SoccerHalo
How is the number 110 written when expanded out to place values in the base 2 (binary) number system? options: 2 x 4 + 3 x 2 + 4 x 1 1 x 2 + 1 x 2 + 0 x 2 1 x 100 + 1 x 10 + 0 x 1 1 x 4 + 1 x 2 + 0 x 1
Answers: 1
image
Computers and Technology, 23.06.2019 12:10, jefersina16
2. fabulously fit offers memberships for$35 per month plus a $50 enrollmentfee. the fitness studio offersmemberships for $40 per month plus a$35 enrollment fee. in how many monthswill the fitness clubs cost the same? what will the cost be?
Answers: 1
image
Computers and Technology, 24.06.2019 16:50, bella7524
7.23 main lab 7 - online shopping cart background this main lab extends the earlier prep lab "online shopping cart part 1". (you should save this as a separate project from the earlier prep lab). you will create an on-line shopping cart like you might use for your on-line purchases. the goal is to become comfortable with setting up classes and using objects. requirements this lab can be done individually or as pair programming. expanded itemtopurchase class (15 points) extend the itemtopurchase class as follows. we will not do unit testing in this lab so we will not be giving you the names of the member functions. create good ones on your own. create a parameterized constructor to assign item name, item description, item price, and item quantity (default values of "none" for name and description, and 0 for price and quantity). additional public member functions set an item description get an item description print the cost of an item - outputs the item name followed by the quantity, price, and subtotal (see example) print the description of an item - outputs the item name and description (see example) additional private data members a string for the description of the item. example output of the function which prints the cost of an item: bottled water 10 @ $1.50 = $15.00 example output of the function which prints the item description:
Answers: 1
image
Computers and Technology, 24.06.2019 23:30, soapai
True or false when a host gets an ip address from a dhcp server it is said to be configured manually
Answers: 1
Do you know the correct answer?
Given the following output and main function and write the class definitions for the Jedi, Master, a...

Questions in other subjects:

Konu
Mathematics, 13.01.2021 18:50