Skip to content

Commit

Permalink
Update MovieManagement.java
Browse files Browse the repository at this point in the history
  • Loading branch information
adhilsalim committed Feb 23, 2023
1 parent 578c385 commit cdd4675
Showing 1 changed file with 34 additions and 32 deletions.
66 changes: 34 additions & 32 deletions etc/Movie Management/new/MovieManagement.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public static void main(String[] args) {
md.cast = new String[md_castNumber];
for (int j = 0; j < md_castNumber; j++) {
System.out.print("ENTER CAST " + (j + 1) + " FOR MOVIE : ");
// scan.nextLine();
md.cast[j] = scan.next();
}

Expand All @@ -78,7 +77,7 @@ public static void main(String[] args) {
System.out.print("ENTER NAME FOR THEATRE : ");
td.theatreName = scan.nextLine();

System.out.print("ENTER MOVIE ID FOR THEATRE : ");
System.out.print("ENTER MOVIE NUMBER FOR THEATRE :");
int td_movieId = scan.nextInt();

td.movie = new Integer[td_movieId];
Expand All @@ -104,36 +103,39 @@ public static void main(String[] args) {
// GETTING OPTION
System.out.print("ENTER OPTION : ");
int option = scan.nextInt();

switch (option) {
case 1:
mm.displayMovieDetails();
break;
case 2:
System.out.print("ENTER MOVIE ID TO DELETE : ");
int movieId = scan.nextInt();
mm.deleteMovie(movieId);
break;
case 3:
mm.sortMovieDetails();
break;
case 4:
mm.displayTheatreDetails();
break;
case 5:
System.out.print("ENTER THEATRE ID TO DELETE : ");
int theatreId = scan.nextInt();
mm.deleteTheatre(theatreId);
break;
case 6:
mm.displayMoviesWithSameCast();
break;
case 7:
System.exit(0);
break;
default:
System.out.println("INVALID OPTION");
break;
Boolean EXIT_LOOP = false;
while (!EXIT_LOOP) {

switch (option) {
case 1:
mm.displayMovieDetails();
break;
case 2:
System.out.print("ENTER MOVIE ID TO DELETE : ");
int movieId = scan.nextInt();
mm.deleteMovie(movieId);
break;
case 3:
mm.sortMovieDetails();
break;
case 4:
mm.displayTheatreDetails();
break;
case 5:
System.out.print("ENTER THEATRE ID TO DELETE : ");
int theatreId = scan.nextInt();
mm.deleteTheatre(theatreId);
break;
case 6:
mm.displayMoviesWithSameCast();
break;
case 7:
EXIT_LOOP = true;
break;
default:
System.out.println("INVALID OPTION");
break;
}
}

scan.close();
Expand Down

0 comments on commit cdd4675

Please sign in to comment.