Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // CATEGORIES TEST
- File file;
- Scanner scan= new Scanner(System.in);
- // Test the categories by typing "Yes"
- System.out.println("Do you want to see categories of offenses? Press 'Yes' to see.");
- String checkAttachements = scan.nextLine();
- if(checkAttachements=="Yes") {
- do {
- // Test the categories by choosing attachement
- System.out.println("Choose attachement 1-5 (Type 1,2,3,4 or 5) to see categories in it");
- int attachement = scan.nextInt();
- switch(attachement) {
- case 1:
- file = new File("zalacznik1.txt");
- readFile(file);
- break;
- case 2:
- file = new File("zalacznik2.txt");
- readFile(file);
- break;
- case 3:
- file = new File("zalacznik3.txt");
- readFile(file);
- break;
- case 4:
- file = new File("zalacznik4.txt");
- readFile(file);
- break;
- case 5:
- file = new File("zalacznik5.txt");
- readFile(file);
- break;
- default:
- System.out.println("Unknown attachement");
- break;
- }
- System.out.println("Stop or again? Press Exit if you want to stop or No if not");
- checkAttachements = scan.nextLine();
- } while(checkAttachements!="Exit");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement