Advertisement
Jserrano331

CinemaBookingSystem

Dec 18th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.88 KB | None | 0 0
  1. package CinemaBookingSystem2;
  2. //Justin Serrano
  3. //OOPDA Section1
  4. import java.util.*;
  5.  
  6. public class CinemaBookingSystem  {
  7.    
  8.     public static void main(String[] args) {
  9.         IMAX theater1=new IMAX(1,13.00,50);
  10.         theater1.addMovie("John Wick 2", "5:00", "Standard");
  11.         theater1.addMovie("Thor: Ragnarok","7:00","Standard");
  12.         theater1.addMovie("Justice League","9:00","Standard");
  13.         theater1.addMovie("Star Wars: The Last Jedi","11:00","Standard");
  14.        
  15.         IMAX theater2=new IMAX(2,14.00,50);
  16.         theater2.addMovie("John Wick 2", "5:00", "3D");
  17.         theater2.addMovie("Thor: Ragnarok","7:00","3D");
  18.         theater2.addMovie("Justice League","9:00","3D");
  19.         theater2.addMovie("Star Wars: The Last Jedi","11:00","3D");
  20.        
  21.         TraditionalTheater theater3=new TraditionalTheater(3,12.00,100);
  22.         theater3.addMovie("John Wick 2", "5:00", "3D");
  23.         theater3.addMovie("Thor: Ragnarok","7:00","3D");
  24.         theater3.addMovie("Justice League","9:00","3D");
  25.         theater3.addMovie("Star Wars: The Last Jedi","11:00","3D");
  26.        
  27.         TraditionalTheater theater4=new TraditionalTheater(4,11.00,100);
  28.         theater4.addMovie("John Wick 2", "5:00", "Standard");
  29.         theater4.addMovie("Thor: Ragnarok","7:00","Standard");
  30.         theater4.addMovie("Justice League","9:00","Standard");
  31.         theater4.addMovie("Star Wars: The Last Jedi","11:00","Standard");
  32.        
  33.         System.out.println("Welcome! If you would like to search our current movie listings, please type 1.");
  34.         System.out.println("If you already know your movie and time, please type 2.");
  35.         System.out.println("If you would like to exit out of our booking system, please type 3.");
  36.         Scanner keyPress=new Scanner(System.in);
  37.         int optionChosen=keyPress.nextInt();
  38.  
  39.             if(optionChosen==1) {
  40.                 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.");
  41.                 Scanner stringInput=new Scanner(System.in);
  42.                 String searchOptionChosen=stringInput.next();
  43.                
  44.                     if(searchOptionChosen.equals("time")||searchOptionChosen.equals("Time")) {
  45.                         String timeChosen=stringInput.next();
  46.                         System.out.println("Theater 1 is playing: "+theater1.searchByTime(timeChosen).getMovieName());
  47.                         System.out.println("    Theater type: "+theater1.getTheaterType());
  48.                         System.out.println("    Theater format: "+theater1.searchByTime(timeChosen).getMovieFormat());
  49.                            
  50.                         System.out.println("Theater 2 is playing: "+theater2.searchByTime(timeChosen).getMovieName());
  51.                         System.out.println("    Theater type: "+theater2.getTheaterType());
  52.                         System.out.println("    Theater format: "+theater2.searchByTime(timeChosen).getMovieFormat());
  53.                            
  54.                         System.out.println("Theater 3 is playing: "+theater3.searchByTime(timeChosen).getMovieName());
  55.                         System.out.println("    Theater type: "+theater3.getTheaterType());
  56.                         System.out.println("    Theater format: "+theater3.searchByTime(timeChosen).getMovieFormat());
  57.                            
  58.                         System.out.println("Theater 4 is playing: "+theater4.searchByTime(timeChosen).getMovieName());
  59.                         System.out.println("    Theater type: "+theater4.getTheaterType());
  60.                         System.out.println("    Theater format: "+theater4.searchByTime(timeChosen).getMovieFormat());
  61.                        
  62.                     }
  63.                     else if(searchOptionChosen.equals("name")||searchOptionChosen.equals("Name")) {
  64.                         Scanner stringInput2=new Scanner(System.in);
  65.                         String nameChosen=stringInput2.nextLine();
  66.                         //theater1.testMovieName();
  67.                         System.out.print("Theater 1 is playing: ");
  68.                         theater1.searchByName(nameChosen);
  69.                         System.out.print("Theater 2 is playing: ");
  70.                         theater2.searchByName(nameChosen);
  71.                         System.out.print("Theater 3 is playing: ");
  72.                         theater3.searchByName(nameChosen);
  73.                         System.out.print("Theater 4 is playing: ");
  74.                         theater4.searchByName(nameChosen);
  75.  
  76.                     }
  77.            
  78.             }
  79.             else if(optionChosen==2) {
  80.                 System.out.println("Please choose your movie");
  81.                
  82.  
  83.                
  84.                
  85.  
  86.             }
  87.         }
  88.  
  89.  
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement