Advertisement
Guest User

Aynemoi

a guest
Nov 18th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 11.55 KB | None | 0 0
  1. package hundreds;
  2. import java.util.*;
  3. public class helping{
  4.     public static void main(String[] args){
  5.         Scanner input = new Scanner(System.in);
  6.        
  7.         int Places[] = new int[10];            //{"Clark","Manila","Cagayan De Oro","Davao","Iloilo","Caticlan","Tacloban","Cebu","Siargao","Puerto Prinsesa"};
  8.         Places[0] = 1;    Places[1] = 2;     Places[2] = 3;     Places[3] = 4;    Places[4] = 5;
  9.         Places[5] = 6;        Places[6] = 7;        Places[7] = 8;        Places[8] = 9;        Places[9] = 10;
  10.        
  11.         int BackToMainMenu;
  12.         int TicketPricesSelection;
  13.         int LogNamesBackButton;
  14.         //String[]Names = new String[]{"FirstName","MiddleName","LastName"};
  15.         int Destination;
  16.         int Food = 1,SisigQuan=0,KalderetaQuan=0,FinalPriceFood=0;
  17.         int Drink = 1,SodaQuan=0,WaterQuan=0,FinalPriceDrink=0;
  18.         int i=1;
  19.         int FinalPrice=0;
  20.         int DateDepartureMonth,DateDepartureDay, DateDepartureYear;
  21.         int AddAMeal=0;
  22.         int MMLoop=0,pl;
  23.         int PlacesPrice;
  24.        
  25.        
  26.           int ctr=3;
  27.             int max= 49;
  28.             String[][] log_name = new String[50][3];
  29.             log_name[0][0]="GERALD";    log_name[1][0]="MOISES"; log_name[2][0]="Example1";
  30.             log_name[0][1]="CUNANAN";    log_name[1][1]="NULL";    log_name[2][1]="Example2";
  31.             log_name[0][2]="VALENCIA";    log_name[1][2]="YUMUL";    log_name[2][2]="Example3";
  32.            
  33.             String[] questions= {"Enter your First Name: ","Enter your Middle Name: ","Enter your Last Name: "};
  34.             String[] name= {"First Name: ","Middle Name: ","Last Name: ",};
  35.             int temp=0;
  36.        
  37.         //String[]questions= {"Enter your First name: ","Enter your Middle name: ","Enter your Last name: "};
  38.         //String[]name={"First Name: ","Middle Name: ","Last Name: "};
  39.         String[] pNames = new String[30];
  40.        
  41.         for(MMLoop=0;MMLoop<20;MMLoop++){
  42.            
  43.             System.out.println("===MAIN MENU===");
  44.         System.out.println("(1) Book a ticket");
  45.         System.out.println("(2) Ticket Price");
  46.         System.out.println("(3) Log Names");
  47.         System.out.println("(4) Our Mission");
  48.         System.out.println("(5) Our Vision");
  49.         System.out.print("Please select a number: ");
  50.         BackToMainMenu = input.nextInt();
  51.        
  52.        
  53.         switch(BackToMainMenu){
  54.         case 1:
  55.            
  56.             for(int x = 0; x <3; x++){
  57.                 System.out.print(questions[x]);
  58.                 log_name[ctr][x] = input.next();
  59.             }
  60.             ctr++;
  61.                
  62.             System.out.println("Enter Destination: ");
  63.            
  64.             for(pl=0;pl<1;pl++){
  65.                
  66.             System.out.println("(1) Clark: PHP1500");
  67.             System.out.println("(2) Manila: PHP1200");
  68.             System.out.println("(3) Cagayan de Oro: PHP2000");
  69.             System.out.println("(4) Davao: PHP2100");
  70.             System.out.println("(5) Iloilo: PHP3000");
  71.             System.out.println("(6) Caticlan: PHP1200");
  72.             System.out.println("(7) Tacloban: PHP2800");
  73.             System.out.println("(8) Cebu: PHP2000");
  74.             System.out.println("(9) Siargao: PHP1700");
  75.             System.out.println("(10) Puerto Prinsesa: PHP3500");
  76.             System.out.println("Please select a number: ");
  77.             Places[pl] = input.nextInt();
  78.            
  79.            
  80.            
  81.             if(Places[pl]==1){
  82.                 System.out.println("You chose Clark.");
  83.                 Places[0] = 1500;
  84.             }
  85.             else if(Places[pl]==2){
  86.                 System.out.println("You chose Manila");
  87.                 Places[1] = 1200;
  88.             }
  89.             else if(Places[pl]==3){
  90.                 System.out.println("You chose Cagayan de Oro");
  91.                 Places[2] = 2000;
  92.             }
  93.             else if(Places[pl]==4){
  94.                 System.out.println("You chose Davao");
  95.                 Places[3] =  2100;
  96.             }
  97.             else if(Places[pl]==5){
  98.                 System.out.println("You chose Iloilo");
  99.                 Places[4] = 3000;
  100.             }
  101.             else if(Places[pl]==6){
  102.                 System.out.println("You chose Caticlan");
  103.                 Places[5] = 1200;
  104.             }
  105.             else if(Places[pl]==7){
  106.                 System.out.println("You chose Tacloban");
  107.                 Places[6] = 2800;
  108.             }
  109.             else if(Places[pl]==8){
  110.                 System.out.println("You chose Cebu");
  111.                 Places[7] = 2000;
  112.             }
  113.             else if(Places[pl]==9){
  114.                 System.out.println("You chose Siargao");
  115.                 Places[8] = 1700;
  116.             }
  117.             else if(Places[pl]==10){
  118.                 System.out.println("You chose Puerto Prinsesa");
  119.                 Places[9] = 3500;
  120.             }
  121.            
  122.             System.out.println(""+Places[pl]);
  123.             }
  124.            
  125.            
  126.             System.out.println("SELECT DATE OF DEPARTURE: ");
  127.             System.out.println("Month: ");
  128.             DateDepartureMonth = input.nextInt();
  129.             System.out.println("Day: ");
  130.             DateDepartureDay = input.nextInt();
  131.             System.out.println("Year: ");
  132.             DateDepartureYear = input.nextInt();
  133.            
  134.             System.out.println("Add a meal? ");
  135.             System.out.println("1. Yes");
  136.             System.out.println("2. No");
  137.             System.out.println("Enter the Number: ");
  138.             AddAMeal = input.nextInt();
  139.            
  140.             switch(AddAMeal){
  141.             case 1:
  142.                 System.out.println("Showing list...");
  143.                 for(;i<10;i++){
  144.                     System.out.println("What Food Do you want? ");
  145.                     System.out.println("1. Sisig   -   PHP 90.00");
  146.                     System.out.println("2. Kaldereta   -   PHP 80.00");
  147.                     System.out.println("3. Done");
  148.                     System.out.println("Enter the Number: ");
  149.                     Food = input.nextInt();
  150.                    
  151.                    
  152.                 if(Food==1){
  153.                     System.out.println("How Many? ");
  154.                     SisigQuan = input.nextInt();
  155.                     System.out.println("You ordered "+SisigQuan+" Sisig.\n");}
  156.                
  157.                 else if(Food==2){
  158.                     System.out.println("How Many? ");
  159.                     KalderetaQuan = input.nextInt();
  160.                     System.out.println("You ordered "+KalderetaQuan+" Kaldereta.\n");}
  161.                
  162.                 else if(Food==3){
  163.                     FinalPriceFood = SisigQuan*90 + KalderetaQuan*80;
  164.                     System.out.println("The Final Price is: "+FinalPriceFood);
  165.                     break;}
  166.                
  167.                
  168.                 }
  169.                
  170.                 for(;i<10;i++){
  171.                     System.out.println("What Drink Do you want? ");
  172.                     System.out.println("1. Soda   -   PHP 25.00");
  173.                     System.out.println("2. Water   -   PHP 15.00");
  174.                     System.out.println("3. Done");
  175.                     System.out.println("Enter the Number: ");
  176.                     Drink = input.nextInt();
  177.                        
  178.                 if(Drink==1){
  179.                     System.out.println("How Many? ");
  180.                     SodaQuan = input.nextInt();
  181.                     System.out.println("You ordered "+SodaQuan+" Soda.\n");}
  182.                
  183.                 else if(Drink==2){
  184.                     System.out.println("How Many? ");
  185.                     WaterQuan = input.nextInt();
  186.                     System.out.println("You ordered "+WaterQuan+" Water.\n");}
  187.                
  188.                 else if(Drink==3){
  189.                     FinalPriceDrink = SodaQuan*25 + WaterQuan*15;
  190.                     System.out.println("The Final Price is: "+FinalPriceDrink);
  191.                
  192.                     FinalPrice = SisigQuan*90 + KalderetaQuan*80 + SodaQuan*25 + WaterQuan*15;
  193.                    
  194.                     System.out.println("==============================");
  195.                     System.out.println("========GROUP 1 AIRPORT=======");
  196.                     //System.out.println("NAME: "+Names[0].toUpperCase()+" "+Names[1].toUpperCase()+" "+Names[2].toUpperCase()+"");
  197. //                    System.out.println("From: Mabalacat \nTo: "+Places[pl]+"");
  198.                     System.out.println("---Date of Departure---");
  199.                     System.out.println(""+DateDepartureMonth+"/"+DateDepartureDay+"/"+DateDepartureYear+"");
  200.                     System.out.println("------Foods------");
  201.                     System.out.println(""+SisigQuan+" Sisig.");
  202.                     System.out.println(""+KalderetaQuan+" Kaldereta.");
  203.                     System.out.println("------Drinks------");
  204.                     System.out.println(""+SodaQuan+" Soda.");
  205.                     System.out.println(""+WaterQuan+" Water.");
  206.                     System.out.println("-----------------------------");
  207.                     System.out.println("Total Price is: "+FinalPrice);
  208.                     System.out.println("==============================\n");
  209.                    
  210.                     break;}
  211.                 }
  212.                
  213.                
  214.                
  215.                 break;
  216.             case 2:
  217.                
  218.                 System.out.println("==============================");
  219.                 System.out.println("========GROUP 1 AIRPORT=======");
  220.                 //System.out.println("NAME: "+Names[0].toUpperCase()+" "+Names[1].toUpperCase()+" "+Names[2].toUpperCase()+"");
  221.                 System.out.println("From: Mabalacat \nTo: "+Places[pl]+"");
  222.                 System.out.println("---Date of Departure---");
  223.                 System.out.println(""+DateDepartureMonth+"/"+DateDepartureDay+"/"+DateDepartureYear+"");
  224.                 System.out.println("-----------------------------");
  225.                 System.out.println("Total Price is: "+Places[pl]);
  226.                 System.out.println("==============================\n");
  227.                 break;
  228.             }
  229.            
  230.             break;
  231.            
  232.        
  233.            
  234.        
  235.        
  236.         case 2:
  237.         System.out.println("--Ticket Prices--");
  238.         System.out.println("Clark: PHP1500");
  239.         System.out.println("Manila: PHP1200");
  240.         System.out.println("Cagayan de Oro: PHP2000");
  241.         System.out.println("Davao: PHP2100");
  242.         System.out.println("Iloilo: PHP3000");
  243.         System.out.println("Caticlan: PHP1200");
  244.         System.out.println("Tacloban: PHP2800");
  245.         System.out.println("Cebu: PHP2000");
  246.         System.out.println("Siargao: PHP1700");
  247.         System.out.println("Puerto Prinsesa: PHP3500");
  248.         System.out.println("----------------------");
  249.         System.out.println("(1) Main Menu");
  250.         System.out.println("Please select a number: ");
  251.         TicketPricesSelection = input.nextInt();
  252.         break;
  253.        
  254.        
  255.         case 3:
  256.         System.out.println("--Log Names--");
  257.          for(int y = 0; y< ctr; y++){
  258.              System.out.print(y+1+" ");
  259.              for(int x = 0; x < 3; x++){
  260.                  System.out.print(log_name[y][x].toUpperCase()+" ");
  261.              }
  262.              System.out.println("");
  263.          }
  264.        
  265.            
  266.         System.out.println("\n(1) Return to Main Menu");
  267.         System.out.println("Please select a number: ");
  268.         LogNamesBackButton = input.nextInt();
  269.        
  270.        
  271.             }
  272.         }
  273.        
  274.        
  275.     }
  276. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement