Question: How to complete the MovieTheater program below that prompts the user for the number of adult and child tickets to purchase as well as whether

  • How to complete the MovieTheater program below that prompts the user for the number of adult and child tickets to purchase as well as whether the movie showing is a matinee. Adult tickets cost $12 and child tickets cost $10. There is a $3 discount for each matinee ticket.

public class MovieTheater {

public static final int ADULT_PRICE = 12;

public static final int CHILD_PRICE = 10;

public static final int MATINEE_DISCOUNT = 3;

public static void main(String[] args) {

}

}

  • Prompt the user for the number of each type of ticket. Output "Invalid value" and exit the program if either number of tickets is less than 0.
  • Prompt the user for whether the movie is a matinee. If the user enters anything that starts with y or Y, it is a matinee. Otherwise, it is not a matinee.
  • Output the price of the tickets formatted as $xx.00 as shown in the examples below. This can be done by simply using String concatenation - you don't need to use printf().
  • Provide "javadoc" for the class, main method, and class constants.
  • See the TaxCalculator program for an example of how to complete the program and document it using javadoc comments.

$ java MovieTheater

Adult tickets: 2

Child tickets: 3

Matinee (y,n): n

Ticket price: $ 54.00

$ java MovieTheater

Adult tickets: 0

Child tickets: 5

Matinee (y,n): yes

Ticket price: $ 35.00

$ java MovieTheater

Adult tickets: -4

Invalid value

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the completed MovieTheater program with your requirements and documentation java public class MovieTheater Adult ticket price in dollars public static final int ADULTPRICE 12 Child ticket price ... View full answer

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 Programming Questions!