Computers and Technology
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!

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:00, abbygriffin2009
Martha is a healer, a healthcare provider, and an experienced nurse. she wants to share her daily experiences, as well as her 12 years of work knowledge, with people who may be interested in health and healing. which mode of internet communication can martha use?
Answers: 3
image
Computers and Technology, 22.06.2019 20:10, ianmartin6080
Assume that minutes is an int variable whose value is 0 or positive. write an expression whose value is "undercooked" or "soft-boiled" or "medium-boiled" or "hard-boiled" or "overcooked" based on the value of minutes. in particular: if the value of minutes is less than 2 the expression's value is "undercooked"; 2-4 would be a "soft-boiled", 5-7 would be "medium-boiled", 8-11 would be "hard-boiled" and 12 or more would be a "overcooked".
Answers: 1
image
Computers and Technology, 23.06.2019 02:00, mayapril813
Consider the following function main: int main() { int alpha[20]; int beta[20]; int matrix[10][4]; . . } a. write the definition of the function inputarray that prompts the user to input 20 numbers and stores the numbers into alpha. b. write the definition of the function doublearray that initializes the elements of beta to two times the corresponding elements in alpha. make sure that you prevent the function from modifying the elements of alpha. c. write the definition of the function copyalphabeta that stores alpha into the first five rows of matrix and beta into the last five rows of matrix. make sure that you prevent the function from modifying the elements of alpha and beta. d. write the definition of the function printarray that prints any onedimensional array of type int. print 15 elements per line. e. write a c11 program that tests the function main and the functions discussed in parts a through d. (add additional functions, such as printing a two-dimensional array, as needed.)
Answers: 3
image
Computers and Technology, 24.06.2019 16:00, nothingworksoutforme
Your is an example of personal information that you should keep private.
Answers: 1
Do you know the correct answer?
Using your preferred IDE or this online IDE, perform the following steps. Create a public class na...

Questions in other subjects:

Konu
Mathematics, 15.12.2020 22:30
Konu
English, 15.12.2020 22:30