Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package cinemare;
- import java.util.Scanner;
- /**
- *
- * @author Mohd Alif Nizam
- */
- public class CinemaRe {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- Scanner ind = new Scanner(System.in);
- int no_tic, ch1;
- String[] seat = new String[30];
- int[] seat_no = new int[30];
- for (int i = 0; i < 30; i++) {
- seat[i] = "[" + i + "]";
- }
- int no_tic1;
- String[] seat1 = new String[30];
- int[] seat_no1 = new int[30];
- for (int i = 0; i < 30; i++) {
- seat1[i] = "[" + i + "]";
- }
- while (true) {
- System.out.println("\n************WELCOME TO GSC TERENGGANU ONLINE BOOKING***************");
- System.out.println("\n** 1.FROZEN 2 2.EJEN ALI**");
- System.out.println("\n***********************SELECT YOUR MOVIE***************************");
- ch1 = ind.nextInt();
- switch (ch1) {
- case 1:
- output_Booking("FROZEN 2 MOVIE BOOKING", 2);
- ch1 = ind.nextInt();
- switch (ch1) {
- case 1:
- int index;
- System.out.print("\n NO. OF TICKETS:");
- no_tic = ind.nextInt();
- for (int i = 0; i < 30; i++) {
- if ((i == 10) || (i == 20) || (i == 30)) {
- System.out.println("\n");
- }
- System.out.print(seat[i]);
- }
- System.out.println("\n**SELECT YOUR SEAT**");
- for (int i = 0; i < no_tic; i++) {
- seat_no[i] = ind.nextInt();
- index = seat_no[i];
- seat[index] = "x";
- }
- output_TicketHeader("FROZEN 2 MOVIE");
- for (int i = 0; i < no_tic; i++) {
- System.out.println("** SEAT NO.:" + seat_no[i] + " **");
- }
- System.out.println("** TOTAL AMOUNT:RM" + no_tic * 17 + " **");
- System.out.println("** THANK YOU **");
- System.out.println("***********************************************************");
- break;
- case 2:
- output_SystemExit();
- exit();
- default:
- System.out.println("invalid case");
- }
- case 2:
- output_Booking("EJEN ALI MOVIE BOOKING", 2);
- ch1 = ind.nextInt();
- switch (ch1) {
- case 1:
- int index;
- System.out.print("\n NO. OF TICKETS:");
- no_tic = ind.nextInt();
- for (int i = 0; i < 30; i++) {
- if ((i == 10) || (i == 20) || (i == 30)) {
- System.out.println("\n");
- }
- System.out.print(seat[i]);
- }
- System.out.println("\n**SELECT YOUR SEAT**");
- for (int i = 0; i < no_tic; i++) {
- seat_no[i] = ind.nextInt();
- index = seat_no[i];
- seat[index] = "x";
- }
- output_TicketHeader("AJEN ALI MOVIE");
- for (int i = 0; i < no_tic; i++) {
- System.out.println("** SEAT NO.:" + seat_no[i] + " **");
- }
- System.out.println("** TOTAL AMOUNT:RM" + no_tic * 17 + " **");
- System.out.println("** THANK YOU **");
- System.out.println("***********************************************************");
- break;
- case 2:
- output_SystemExit();
- exit();
- default:
- System.out.println("invalid case");
- }
- }
- }
- // TODO code application logic here
- }
- private static void exit() {
- // TODO Auto-generated method stub
- System.exit(0);
- }
- public static void output_SystemExit() {
- System.out.println("*******************************");
- System.out.print("Thank you! \nPlease Come Again!");
- System.out.println("\n*******************************");
- }
- public static void output_TicketHeader(String movie) {
- System.out.println("***********************************************************");
- System.out.println("** GSC TERENGGANU **");
- System.out.println("**DATE: ~" + movie + "~ TIMING: **");
- System.out.println("**18-11-18 7:00AM **");
- }
- public static void output_Booking(String bookingMovie, int screen) {
- System.out.println("\n______________" + bookingMovie + "_____________");
- System.out.println("\n **************screen " + screen + "*************** ");
- System.out.println("\n 1.booking \n 2.exit ");
- }
- }
- //EJEN ALI MOVIE BOOKING
- //FROZEN 2 MOVIE BOOKING
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement