Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago