Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package hundreds;
- import java.util.*;
- public class helping{
- public static void main(String[] args){
- Scanner input = new Scanner(System.in);
- int Places[] = new int[10]; //{"Clark","Manila","Cagayan De Oro","Davao","Iloilo","Caticlan","Tacloban","Cebu","Siargao","Puerto Prinsesa"};
- Places[0] = 1; Places[1] = 2; Places[2] = 3; Places[3] = 4; Places[4] = 5;
- Places[5] = 6; Places[6] = 7; Places[7] = 8; Places[8] = 9; Places[9] = 10;
- int BackToMainMenu;
- int TicketPricesSelection;
- int LogNamesBackButton;
- //String[]Names = new String[]{"FirstName","MiddleName","LastName"};
- int Destination;
- int Food = 1,SisigQuan=0,KalderetaQuan=0,FinalPriceFood=0;
- int Drink = 1,SodaQuan=0,WaterQuan=0,FinalPriceDrink=0;
- int i=1;
- int FinalPrice=0;
- int DateDepartureMonth,DateDepartureDay, DateDepartureYear;
- int AddAMeal=0;
- int MMLoop=0,pl;
- int PlacesPrice;
- int ctr=3;
- int max= 49;
- String[][] log_name = new String[50][3];
- log_name[0][0]="GERALD"; log_name[1][0]="MOISES"; log_name[2][0]="Example1";
- log_name[0][1]="CUNANAN"; log_name[1][1]="NULL"; log_name[2][1]="Example2";
- log_name[0][2]="VALENCIA"; log_name[1][2]="YUMUL"; log_name[2][2]="Example3";
- String[] questions= {"Enter your First Name: ","Enter your Middle Name: ","Enter your Last Name: "};
- String[] name= {"First Name: ","Middle Name: ","Last Name: ",};
- int temp=0;
- //String[]questions= {"Enter your First name: ","Enter your Middle name: ","Enter your Last name: "};
- //String[]name={"First Name: ","Middle Name: ","Last Name: "};
- String[] pNames = new String[30];
- for(MMLoop=0;MMLoop<20;MMLoop++){
- System.out.println("===MAIN MENU===");
- System.out.println("(1) Book a ticket");
- System.out.println("(2) Ticket Price");
- System.out.println("(3) Log Names");
- System.out.println("(4) Our Mission");
- System.out.println("(5) Our Vision");
- System.out.print("Please select a number: ");
- BackToMainMenu = input.nextInt();
- switch(BackToMainMenu){
- case 1:
- for(int x = 0; x <3; x++){
- System.out.print(questions[x]);
- log_name[ctr][x] = input.next();
- }
- ctr++;
- System.out.println("Enter Destination: ");
- for(pl=0;pl<1;pl++){
- System.out.println("(1) Clark: PHP1500");
- System.out.println("(2) Manila: PHP1200");
- System.out.println("(3) Cagayan de Oro: PHP2000");
- System.out.println("(4) Davao: PHP2100");
- System.out.println("(5) Iloilo: PHP3000");
- System.out.println("(6) Caticlan: PHP1200");
- System.out.println("(7) Tacloban: PHP2800");
- System.out.println("(8) Cebu: PHP2000");
- System.out.println("(9) Siargao: PHP1700");
- System.out.println("(10) Puerto Prinsesa: PHP3500");
- System.out.println("Please select a number: ");
- Places[pl] = input.nextInt();
- if(Places[pl]==1){
- System.out.println("You chose Clark.");
- Places[0] = 1500;
- }
- else if(Places[pl]==2){
- System.out.println("You chose Manila");
- Places[1] = 1200;
- }
- else if(Places[pl]==3){
- System.out.println("You chose Cagayan de Oro");
- Places[2] = 2000;
- }
- else if(Places[pl]==4){
- System.out.println("You chose Davao");
- Places[3] = 2100;
- }
- else if(Places[pl]==5){
- System.out.println("You chose Iloilo");
- Places[4] = 3000;
- }
- else if(Places[pl]==6){
- System.out.println("You chose Caticlan");
- Places[5] = 1200;
- }
- else if(Places[pl]==7){
- System.out.println("You chose Tacloban");
- Places[6] = 2800;
- }
- else if(Places[pl]==8){
- System.out.println("You chose Cebu");
- Places[7] = 2000;
- }
- else if(Places[pl]==9){
- System.out.println("You chose Siargao");
- Places[8] = 1700;
- }
- else if(Places[pl]==10){
- System.out.println("You chose Puerto Prinsesa");
- Places[9] = 3500;
- }
- System.out.println(""+Places[pl]);
- }
- System.out.println("SELECT DATE OF DEPARTURE: ");
- System.out.println("Month: ");
- DateDepartureMonth = input.nextInt();
- System.out.println("Day: ");
- DateDepartureDay = input.nextInt();
- System.out.println("Year: ");
- DateDepartureYear = input.nextInt();
- System.out.println("Add a meal? ");
- System.out.println("1. Yes");
- System.out.println("2. No");
- System.out.println("Enter the Number: ");
- AddAMeal = input.nextInt();
- switch(AddAMeal){
- case 1:
- System.out.println("Showing list...");
- for(;i<10;i++){
- System.out.println("What Food Do you want? ");
- System.out.println("1. Sisig - PHP 90.00");
- System.out.println("2. Kaldereta - PHP 80.00");
- System.out.println("3. Done");
- System.out.println("Enter the Number: ");
- Food = input.nextInt();
- if(Food==1){
- System.out.println("How Many? ");
- SisigQuan = input.nextInt();
- System.out.println("You ordered "+SisigQuan+" Sisig.\n");}
- else if(Food==2){
- System.out.println("How Many? ");
- KalderetaQuan = input.nextInt();
- System.out.println("You ordered "+KalderetaQuan+" Kaldereta.\n");}
- else if(Food==3){
- FinalPriceFood = SisigQuan*90 + KalderetaQuan*80;
- System.out.println("The Final Price is: "+FinalPriceFood);
- break;}
- }
- for(;i<10;i++){
- System.out.println("What Drink Do you want? ");
- System.out.println("1. Soda - PHP 25.00");
- System.out.println("2. Water - PHP 15.00");
- System.out.println("3. Done");
- System.out.println("Enter the Number: ");
- Drink = input.nextInt();
- if(Drink==1){
- System.out.println("How Many? ");
- SodaQuan = input.nextInt();
- System.out.println("You ordered "+SodaQuan+" Soda.\n");}
- else if(Drink==2){
- System.out.println("How Many? ");
- WaterQuan = input.nextInt();
- System.out.println("You ordered "+WaterQuan+" Water.\n");}
- else if(Drink==3){
- FinalPriceDrink = SodaQuan*25 + WaterQuan*15;
- System.out.println("The Final Price is: "+FinalPriceDrink);
- FinalPrice = SisigQuan*90 + KalderetaQuan*80 + SodaQuan*25 + WaterQuan*15;
- System.out.println("==============================");
- System.out.println("========GROUP 1 AIRPORT=======");
- //System.out.println("NAME: "+Names[0].toUpperCase()+" "+Names[1].toUpperCase()+" "+Names[2].toUpperCase()+"");
- // System.out.println("From: Mabalacat \nTo: "+Places[pl]+"");
- System.out.println("---Date of Departure---");
- System.out.println(""+DateDepartureMonth+"/"+DateDepartureDay+"/"+DateDepartureYear+"");
- System.out.println("------Foods------");
- System.out.println(""+SisigQuan+" Sisig.");
- System.out.println(""+KalderetaQuan+" Kaldereta.");
- System.out.println("------Drinks------");
- System.out.println(""+SodaQuan+" Soda.");
- System.out.println(""+WaterQuan+" Water.");
- System.out.println("-----------------------------");
- System.out.println("Total Price is: "+FinalPrice);
- System.out.println("==============================\n");
- break;}
- }
- break;
- case 2:
- System.out.println("==============================");
- System.out.println("========GROUP 1 AIRPORT=======");
- //System.out.println("NAME: "+Names[0].toUpperCase()+" "+Names[1].toUpperCase()+" "+Names[2].toUpperCase()+"");
- System.out.println("From: Mabalacat \nTo: "+Places[pl]+"");
- System.out.println("---Date of Departure---");
- System.out.println(""+DateDepartureMonth+"/"+DateDepartureDay+"/"+DateDepartureYear+"");
- System.out.println("-----------------------------");
- System.out.println("Total Price is: "+Places[pl]);
- System.out.println("==============================\n");
- break;
- }
- break;
- case 2:
- System.out.println("--Ticket Prices--");
- System.out.println("Clark: PHP1500");
- System.out.println("Manila: PHP1200");
- System.out.println("Cagayan de Oro: PHP2000");
- System.out.println("Davao: PHP2100");
- System.out.println("Iloilo: PHP3000");
- System.out.println("Caticlan: PHP1200");
- System.out.println("Tacloban: PHP2800");
- System.out.println("Cebu: PHP2000");
- System.out.println("Siargao: PHP1700");
- System.out.println("Puerto Prinsesa: PHP3500");
- System.out.println("----------------------");
- System.out.println("(1) Main Menu");
- System.out.println("Please select a number: ");
- TicketPricesSelection = input.nextInt();
- break;
- case 3:
- System.out.println("--Log Names--");
- for(int y = 0; y< ctr; y++){
- System.out.print(y+1+" ");
- for(int x = 0; x < 3; x++){
- System.out.print(log_name[y][x].toUpperCase()+" ");
- }
- System.out.println("");
- }
- System.out.println("\n(1) Return to Main Menu");
- System.out.println("Please select a number: ");
- LogNamesBackButton = input.nextInt();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement