Guest User

Untitled

a guest
Jul 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. private void subMenuAddMovie()
  2. {
  3. System.out.println("\n1. Add ISOImage to collection\n" +
  4. "2.Add DVD to collection");
  5.  
  6. Scanner keyboard = new Scanner(System.in);
  7. int choice = keyboard.nextInt();
  8. boolean output = false;
  9.  
  10. System.out.println("Now input some information about the movie...");
  11. System.out.print("Title: ");
  12. String title = keyboard.nextLine();
  13.  
  14. System.out.print("ISBN: ");
  15. String isbn = keyboard.nextLine();
  16.  
  17. System.out.print("Length: ");
  18. int length = keyboard.nextInt();
  19.  
  20. System.out.print("Production year: ");
  21. int year = keyboard.nextInt();
  22.  
  23. System.out.print("Studio name: ");
  24. String studio = keyboard.nextLine();
  25. Movie temp = null;
  26.  
  27. switch(choice)
  28. {
  29. case 1:
  30. System.out.print("ISOImage size: ");
  31. float size = keyboard.nextFloat();
  32. temp = new ISOImage(title, isbn, length, year, new Studio(studio), size);
  33. break;
  34. case 2:
  35. System.out.print("Nr of Discs: ");
  36. int discs = keyboard.nextInt();
  37. temp = new DVD(title, isbn, length, year, new Studio(studio), discs);
  38. break;
  39. }
  40.  
  41. this.myMovies.put(isbn, temp);
  42. }
Add Comment
Please, Sign In to add comment