Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void newFilmsTxt() throws IOException//Για την ContentΑdmins
- {
- PrintWriter pw = new PrintWriter(new FileWriter("films.txt", true));
- boolean check;
- do
- {
- check=true;
- try
- {
- System.out.println("Insert film ID");
- filmID = sc.nextInt();
- }
- catch(InputMismatchException e)
- {
- System.out.println("Film ID must be an integer.");
- check=false;
- }
- finally
- {
- sc.nextLine();
- }
- } while (check!=true);
- CheckFilmID(filmID);
- pw.println(filmID);
- System.out.println("Insert film title");
- filmTitle = sc.nextLine();
- pw.println(filmTitle);
- System.out.println("Insert film category");
- filmCategory = sc.nextLine();
- pw.println(filmCategory);
- System.out.println("Insert film description");
- filmDescription = sc.nextLine();
- pw.println(filmDescription);
- System.out.println("Insert film price");
- do
- {
- check=true;
- try
- {
- price = sc.nextInt();
- }
- catch(InputMismatchException e)
- {
- System.out.println("Price must be an integer.");
- check=false;
- }
- finally
- {
- sc.nextLine();
- }
- } while (check!=true);
- CheckFilmPrice(price);
- pw.println(price);
- pw.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement