1. Create three (2) classes named Party, Dinner Party, and DemoParty. 2. In the Party class, declare...
Question:
1. Create three (2) classes named Party, Dinner Party, and DemoParty.
2. In the Party class, declare a private variable of int type named numGuests.
3. Create a getter method named getNumGuests() that will allow you to retrieve the value of numGuests.
4. Create a setter method named setNumGuests() with an int parameter named num. In this method, assign num to numGuests.
5. Create a method named showInvitation() that prints"Please come to my party!".
6. Your Dinner Party class should extend the Party class. In the Dinner Party class, declare a private variable of int type named foodChoice.
7. Create a getter method named getFoodChoice() that will allow you to retrieve the value of foodChoice.
8. Create a setter method named setFoodChoice() with an int parameter named choice. In this method, assign choice to foodChoice.
9. Create a showlnvitation() method that overrides the method in the parent class. This method shall print "Please come to my dinner party!".
10. Code the Demo Party class to produce an output similar to the example below.
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill