Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package CinemaBookingSystem2;
- //Justin Serrano
- //OOPDA Section1
- import java.util.*;
- public class CinemaBookingSystem {
- public static void main(String[] args) {
- IMAX theater1=new IMAX(1,13.00,50);
- theater1.addMovie("John Wick 2", "5:00", "Standard");
- theater1.addMovie("Thor: Ragnarok","7:00","Standard");
- theater1.addMovie("Justice League","9:00","Standard");
- theater1.addMovie("Star Wars: The Last Jedi","11:00","Standard");
- IMAX theater2=new IMAX(2,14.00,50);
- theater2.addMovie("John Wick 2", "5:00", "3D");
- theater2.addMovie("Thor: Ragnarok","7:00","3D");
- theater2.addMovie("Justice League","9:00","3D");
- theater2.addMovie("Star Wars: The Last Jedi","11:00","3D");
- TraditionalTheater theater3=new TraditionalTheater(3,12.00,100);
- theater3.addMovie("John Wick 2", "5:00", "3D");
- theater3.addMovie("Thor: Ragnarok","7:00","3D");
- theater3.addMovie("Justice League","9:00","3D");
- theater3.addMovie("Star Wars: The Last Jedi","11:00","3D");
- TraditionalTheater theater4=new TraditionalTheater(4,11.00,100);
- theater4.addMovie("John Wick 2", "5:00", "Standard");
- theater4.addMovie("Thor: Ragnarok","7:00","Standard");
- theater4.addMovie("Justice League","9:00","Standard");
- theater4.addMovie("Star Wars: The Last Jedi","11:00","Standard");
- System.out.println("Welcome! If you would like to search our current movie listings, please type 1.");
- System.out.println("If you already know your movie and time, please type 2.");
- System.out.println("If you would like to exit out of our booking system, please type 3.");
- Scanner keyPress=new Scanner(System.in);
- int optionChosen=keyPress.nextInt();
- if(optionChosen==1) {
- System.out.println("Please select how you would like to search for a movie by typing in 'name' or 'time'. Please type 'exit' when you are done.");
- Scanner stringInput=new Scanner(System.in);
- String searchOptionChosen=stringInput.next();
- if(searchOptionChosen.equals("time")||searchOptionChosen.equals("Time")) {
- String timeChosen=stringInput.next();
- System.out.println("Theater 1 is playing: "+theater1.searchByTime(timeChosen).getMovieName());
- System.out.println(" Theater type: "+theater1.getTheaterType());
- System.out.println(" Theater format: "+theater1.searchByTime(timeChosen).getMovieFormat());
- System.out.println("Theater 2 is playing: "+theater2.searchByTime(timeChosen).getMovieName());
- System.out.println(" Theater type: "+theater2.getTheaterType());
- System.out.println(" Theater format: "+theater2.searchByTime(timeChosen).getMovieFormat());
- System.out.println("Theater 3 is playing: "+theater3.searchByTime(timeChosen).getMovieName());
- System.out.println(" Theater type: "+theater3.getTheaterType());
- System.out.println(" Theater format: "+theater3.searchByTime(timeChosen).getMovieFormat());
- System.out.println("Theater 4 is playing: "+theater4.searchByTime(timeChosen).getMovieName());
- System.out.println(" Theater type: "+theater4.getTheaterType());
- System.out.println(" Theater format: "+theater4.searchByTime(timeChosen).getMovieFormat());
- }
- else if(searchOptionChosen.equals("name")||searchOptionChosen.equals("Name")) {
- Scanner stringInput2=new Scanner(System.in);
- String nameChosen=stringInput2.nextLine();
- //theater1.testMovieName();
- System.out.print("Theater 1 is playing: ");
- theater1.searchByName(nameChosen);
- System.out.print("Theater 2 is playing: ");
- theater2.searchByName(nameChosen);
- System.out.print("Theater 3 is playing: ");
- theater3.searchByName(nameChosen);
- System.out.print("Theater 4 is playing: ");
- theater4.searchByName(nameChosen);
- }
- }
- else if(optionChosen==2) {
- System.out.println("Please choose your movie");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement