Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(1) The Movie, Ticket, Theatre and Patron Classes You will need to define 4 objects as indicated below. You must choose appropriate attribute names so
(1) The Movie, Ticket, Theatre and Patron Classes You will need to define 4 objects as indicated below. You must choose appropriate attribute names so that the test program that follows compiles and runs properly Define a class called Movie that maintains the title of a movie as well as the amount of earnings it has made since it opened at the theatre Define a class called Theatre that keeps track of the Movie object that is currently playing in that theatre. A theatre should also have a seat capacity and keep track of how many seats have been sold for the movie playing. . Each ticket is Define a class called Ticket that represents a ticket to go and watch a movie. only valid for a specific Theatre object. . Define a class called Patron that keeps track of the age of a person as well as the Ticket object that he/she has purchased Write any necessary code so that the following test program works as indicated in the output that follows: public class TestProgram public static void main (String argst1) Movie m = new Movie ("Despicablo Me 3"); System.out.printin(m.title); System.out.printin (m.earnings) Theatre theatre new Theatre (3); System.out.printin (theatre.capacity) System.out.printin (theatre.seatsSold) theatre .moviePlaying m; Patron mary = new Patron (15); System.out.printin (mary.age) System.out.printin (mary.ticket) mary.ticket- new Ticket (theatre) System.out.printin (mary ticket.theatre.moviePlaying. title) Despicable Ne 3 0.0 The expected output is shown here on the right Make sure that your code works before you continue 15 null Despicable Me 3
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