private static void addMovie() { // get the description of the movie from user String title, duration, genre, ratingPG; DateMovie dateMovie; double price; scan.nextLine(); System.out.println("insert the title of new movie"); title = scan.nextLine(); System.out.println("insert the duration of new movie, duration in minute"); duration = scan.nextLine(); System.out.println("insert the genre of the new movie"); genre = chooseMovieType(); scan.nextLine(); System.out.println("insert the RatingPG"); ratingPG = scan.nextLine(); System.out.println("insert the price of the movie in SGD"); price = scan.nextDouble(); System.out.println("insert the director"); scan.nextLine(); String director = scan.nextLine(); System.out.println("How many cast you want to add(at least 2)"); int castNumber = scan.nextInt(); while (castNumber < 2) { System.out.println("please choose at least 2"); System.out.println("How many cast you want to add(at least 2)"); castNumber = scan.nextInt(); } ArrayList<String> castList = new ArrayList<String>(); scan.nextLine(); for (int i = 0; i < castNumber; i++) { System.out.printf("name of cast %d: ", i + 1); String cast = scan.nextLine(); castList.add(cast); } System.out.println("\ninsert the synopsis"); String synopsis = scan.nextLine(); dateMovie = addDateOnNewMovie(title); Movie movie = new Movie(title, duration, ratingPG, genre, dateMovie, price, director, castList, synopsis); if (!dateMovie.getStatus().equals("Coming Soon")) { movieRated.addMovieList(movie); } currentCineplex.addMovie(movie); System.out.println("Changes has been saved to our system\n"); }
private static void editStatusTimeCinema() { System.out.println("Schedule " + currentMovie.getTitle() + " :"); currentMovie.getListDateStatusMovie(); System.out.println("\n"); ArrayList<DateMovie> listMovie = currentMovie.getArrayListOfDateMovie(); System.out.println("Please choose which date you want to configure"); int indexListMovie = scan.nextInt(); DateMovie currentDate = listMovie.get(indexListMovie - 1); System.out.println( "\nPlease choose which one you want to edit on " + currentDate.getStatusTimeMovie()); System.out.println("1) Time"); System.out.println("2) status"); System.out.println("3) cinema"); int timestatus = scan.nextInt(); if (timestatus == 1) { editTime(listMovie.get(indexListMovie - 1)); } else if (timestatus == 2) { System.out.println("insert the new Status"); scan.nextLine(); String newStatus = chooseStatusMovie(); currentDate.setStatus(newStatus); if (!newStatus.equals("Coming Soon")) { movieRated.addMovieList(currentMovie); } } else if (timestatus == 3) { System.out.println("List Cinema: "); int choosenCinema = getIndexCinema(); currentDate.setCinema(currentCineplex.getCinema(choosenCinema - 1)); } else { System.out.println("Sorry your choice is not listed in the system"); System.out.println("Please choose the below option"); System.out.println("1) Quit to Date configuration"); System.out.println("2) Editing Date attribute again"); int option = scan.nextInt(); if (option == 1) { return; } else if (option == 2) { System.out.println(""); editStatusTimeCinema(); return; } return; } }