subject
Computers and Technology, 21.12.2021 14:00 oof5221

Using your preferred IDE or this online IDE, perform the following steps. Create a public class named Party. (If you are using the recommended online IDE, remove 'public'.)
Declare a private int variable named numGuests.
Declare two (2) methods named getNumGuests (of int type) and setNumGuests. The getNumGuests method shall return the value of numGuests. Below is the code for setNumGuests.
public void setGuests(int numGuests) {
this. numGuests = numGuests;
}
Declare another method named displayMessage with a println statement saying "Enjoy the party!"
Create another class named BirthdayParty. This class should be a subclass of the Party class.
In the main method, create a BirthdayParty object named bday.
Declare an int variable to accept the number of guests attending the birthday party.
Use the setNumGuests method on bday to store the value of that variable .
Display the number of guests by calling getNumGuests then call displayMessage.
Sample output:

Enter number of guests: 40

40 guests have been invited.

Enjoy the party!

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:30, DestinyK8033
Why would a programmer use the logical operator and in an if statement? a: when an action is to be taken that requires both conditions to be falseb: when an action is to be taken that requires both conditions to be truec: when an action is to be taken that requires the first condition to be falsed: when an action is to be taken that requires the second condition to be truei took the test and the answer is b.
Answers: 3
image
Computers and Technology, 24.06.2019 02:00, akatherine1738
What is a loop? a. a collection of function definitions at the top of a program b. a line of code that defines a variable and assigns it a value c. a program that opens the turtle graphics window d. a block of code that repeats a specific number of times
Answers: 1
image
Computers and Technology, 24.06.2019 13:20, sanaiajohnson56
In the insert table dialog box, you select the checkbox to create the first row as the header of the table.
Answers: 3
image
Computers and Technology, 24.06.2019 21:50, TamB01
Maddie is traveling to india and would like to document her trip for friends and family to access online. what tool would be best? app blog listserver web page
Answers: 1
You know the right answer?
Using your preferred IDE or this online IDE, perform the following steps. Create a public class na...

Questions in other subjects:

Konu
Mathematics, 04.08.2021 07:10
Konu
Mathematics, 04.08.2021 07:10
Konu
Mathematics, 04.08.2021 07:10
Konu
Mathematics, 04.08.2021 07:10