Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(2) The BoxOffice Class Define a class called BoxOffice that keeps track of two theatres for which it sells movie tickets. The cost of a

image text in transcribed

image text in transcribed

image text in transcribed

(2) The BoxOffice Class Define a class called BoxOffice that keeps track of two theatres for which it sells movie tickets. The cost of a movie ticket is $6.25 for children under 12 years old, $5.75 for adults 65 years old or more and $12.50 for everyone else. The box office should also keep track of the movie that has made the most money in the past. Carefully examine the test program below. Understand how it is supposed to work. Then write the necessary methods so that the code runs properly, producing the correct results. You may NOT alter the test program the TA will be using it to test your code. Note that when tickets are sold to patrons, the title of the movie is provided. You will need to determine which theatre that movie is playing in. As a hint, you can compare two strings using the .equals) method in JAVA as follows String si-...; String S2. . .; if (si.equals (s2)) else Note as well in the program below that the bestMovie) will either be a previous movie that had the whichever has the most earnings most earnings or one of the current playing movies Here is the test program public class BoxOfficeTestProgram [ public static void main (String args[]) f /Create a box office with two theatres, each with a capacity of 5 seats BoxOffice box = new BoxOffice (5, 5); 7Open up a couple of new movies at the box office System.out.println ("Theatre A opens movie: Justice League") box.openMovie ("Justice League", box.theatreA) System.out.println("Theatre B opens movie: Geostorm"); box.openMovie ("Geostorm", box.theatreB) //Now create some patrons Patron pl, p2, p3, p4, p5, p6, p7, p8, p9, pl0, pll, pl2; pl new Patron (15) ; p2 = new Patron (26); p3 = new Patron (7); p4 = new Patron (72); p5 = new Patron (65); p6 = new Patron (11); p7 = new Patron (19); DB = new Patron (17); p9 = new Patron (12) ; p10 = new Patron (14); pll-new Patron (13); p12 = new Patron (16); /... continued on the next page 1/

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

Step: 3

blur-text-image

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

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

More Books

Students also viewed these Databases questions

Question

Explain methods of metal extraction with examples.

Answered: 1 week ago