CS0401 COE0401 Intermediate Java Programming

Total Page:16

File Type:pdf, Size:1020Kb

CS0401 COE0401 Intermediate Java Programming

CS0401 COE0401 Intermediate Java Programming

Summer 2007

Project 1- Movie Theatre

Description: Due date: June 27, 2007 11:59 PM Late Due date: June 29, 2007 11:59 PM

Design and implement a Java application for a movie theatre. This movie theatre shows only three movies at a time. This application should display a description of the three movies along with a picture from the movie. It should also allow the user to buy tickets from the program.

User Interface:

The GUI should look similar to the following:

There are four panels in the above GUI: three panels display the movie details and one panel allows the user to buy tickets. Additional panels may be used in order to nest the panels and organize their contents. Program Design:

This application is formed of three classes: Movie class, MovieTheatrePanel class and MovieTheatre class

Movie class The Movie class has the following members: name of the movie, its genre, the icon used to display the image, the number of minutes, number of tickets bought by the customer for this movie and its release date. In addition to the getters and setters, the Movie class has a method called buyTickets that takes in an integer number of tickets. This method modifies the number of tickets instance variable by adding the number of tickets that the user bought.

MovieTheatrePanel class This class extends JPanel. It is used to display the input panel used by the user to buy tickets. This class should have three objects of class Movie that represent the three different movies.

MovieTheatre class This is the driver class that displays the user interface. It also has a main method that is used to run the program.

Feel free to add any classes or methods that facilitate the implementation. The classes shown above are the minimum required classes.

Requirements

This application processes the user request when the submit button is pressed. It retrieves the data entered by the user and calls the necessary methods used to purchase tickets. It then displays the tickets that the user has already bought. Thus, your program should remember the tickets the user bought already to see all the movies. Here is an example: 1. The user enters the following and presses “Buy Tickets”

2. The following shows on the screen:

Notice that since the user has a student discount the price of the ticket is $6. The price for non-students is $8 per ticket.

3. The user then decides to buy four tickets for Spiderman III movie 4. The program then displays the following:

Thus, the application still remembers that the user has also bought 2 tickets for Shrek III.

Grading

Programming style: 10 pts Variable naming, program readability, comments

Functionality Movie class 25 pts MovieTheatrePanel class 20 pts MovieTheatre class 15 pts

Appearance 20 pts The user interface looks similar to the above GUI

Compiles without errors 10 pts

Extra Credits 10 pts

Submit suggestions for extra credit to the instructor for approval. You must submit it one week before due date.

Recommended publications