Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package helpFiles;
- import java.io.File;
- import java.util.Scanner;
- import java.io.FileReader;
- import java.io.PrintWriter;
- import java.io.FileNotFoundException;
- public class SeatDiscountSystem2 {
- public static void main(String[] args) throws Exception{
- int option;
- try {
- File Seats = new File("seats.txt");
- Scanner mySeatReader = new Scanner(Seats);
- while (mySeatReader.hasNextLine()) {
- String seatValues = mySeatReader.nextLine();
- System.out.println(seatValues);
- }
- mySeatReader.close();
- } catch (FileNotFoundException e) {
- System.out.println("An error occured");
- e.printStackTrace();
- }
- Scanner answer = new Scanner(System.in);
- do {
- do {
- String menu = "\n - - Seat Booking System - - "
- + "\n - - Main Menu - -"
- + "\n 1 - Reserve Seat "
- + "\n 2 - Cancel Seat "
- + "\n 3 - View Seat Reservations "
- + "\n 0 - Quit "
- + "What is your choice? : ";
- System.out.println(menu);
- option = answer.nextInt();
- } while(option < 0 || option > 4);
- switch(option) {
- case 1:
- System.out.println("Reserve Seat");
- break;
- case 2:
- System.out.println("Cancel Seat");
- break;
- case 3:
- System.out.println("View Seat Reservations");
- break;
- }
- }while (option != 0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement