226k views
22 votes
Carly’s Catering provides meals for parties and special events. Write a program that prompts the user for the number of guests attending an event and then computes the total price, which is $35 per person. Display the company motto with the border that you created in the CarlysMotto2 class in Chapter 1, and then display the number of guests, price per guest, and total price. Also display a message that indicates true or false depending on whether the job is classified as a large event—an event with 50 or more guests. Save the file as CarlysEventPrice.java.

User Igaster
by
5.9k points

1 Answer

7 votes

Answer:

Answered below

Step-by-step explanation:

Scanner n = new Scanner(System.in);

System.out.print("Enter number of guests: ");

int numOfGuests = n.nextline();

double pricePerGuest = 35.0;

double totalAmount = numOfGuests * pricePerGuest;

String event = " ";

if ( numOfGuests >= 50){

event = "Large event";

}else{

event = "small event";

}

System.out.print(numOfGuests);

System.out.println(pricePerGuest);

System.out.println( totalAmount);

System.out.println(event);

User Siegfoult
by
6.0k points