Question: Java Question Question 1 - Scanner class user input and if statement practice Pete at Petes Petting Zoo wants a program to work out what

Java Question Question 1 - Scanner class user input and if statement practice Pete at Petes Petting Zoo wants a program to work out what to charge groups of visitors to his childrens zoo. An adults ticket costs $10, a childs ticket cost $5 and a family ticket (for 2 adults and 2 children) costs $26. The program must ask the user to enter the number of adults and the number of children in the group and display to screen the cheapest selection of tickets and the total cost. A sample execution of the program is shown here. Note, if no tickets are required of a particular type no output is given for that ticket type.

Names Data Types
adultTicket Integer
cost Integer
childTicket Integer
familyTickets Integer
numberAdult Integer
numberChildren Integer

I.e.

Number of adults: 2

Number of children: 4

Number of family tickets: 1

Number of child tickets: 2

Total cost: $36

Run the program with the following above examples

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!