Answered step by step
Verified Expert Solution
Question
1 Approved Answer
QUESTION 6 50 poi 5. Write a Java program to do the following. Create a class called Movietheatre. Create variables for the following fields given
QUESTION 6 50 poi 5. Write a Java program to do the following. Create a class called Movietheatre. Create variables for the following fields given below. Get the input from user using Scanner class for the fields given below. - Movietheatre name - use a String variable for this field City where the Movietheatre is located - use a String variable for this field - Number of screens that the movietheatre has - use an integer variable for this field Number of movies screened in this movietheatre - use an integer variable for this field - Ticket cost - use an integer variable for this field Whenever the user input is greater than 5 for the number of screens variable, an exception has to be thrown. Whenever an incorrect input is entered for the ticket cost, an InputMismatchException has to be thrown. Use try-catch blocks in your program to handle the exception in your program Print the output with a caught exception if it occurs in the program otherwise print the values of variables if exception does not occur in the program. Attach File Browse Local Files
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started