SHARE
TWEET

oop

a guest Feb 27th, 2020 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package pack1;
  2. import java.io.*;
  3. public class Class1
  4. {
  5.     public void show ()throws IOException
  6.     {
  7.         InputStreamReader r=new InputStreamReader(System.in);
  8.         BufferedReader br=new BufferedReader(r);
  9.        
  10.         String type1;
  11.         int type;
  12.        
  13.         String num_pass1;
  14.         int num_pass;
  15.        
  16.         String adult1;
  17.         int adult;
  18.        
  19.         String child1;
  20.         int child;
  21.        
  22.         /* START WATER PARK FARE*/
  23.         double water_park_adult=26.00;
  24.         double water_park_children=16.00;
  25.         /* END WATER PARK FARE  */
  26.        
  27.         /* START ETS FARE*/
  28.         double safari_park_adult=36.00;
  29.         double safari_park_children=26.00;
  30.         /* END ETS FARE */
  31.  
  32.         /* SYSTEM START */
  33.         System.out.println("");
  34.         System.out.println("***BUKIT GAMBANG RESORT CITY THEME PARK***");
  35.         System.out.println("");
  36.             System.out.print("Enter number of CUSTOMER  : ");
  37.             num_pass1= br.readLine();
  38.             num_pass=Integer.parseInt(num_pass1);
  39.            
  40.             System.out.print("ADULT              : ");
  41.             adult1= br.readLine();
  42.             adult=Integer.parseInt(adult1);
  43.            
  44.             System.out.print("CHILD              : ");
  45.             child1= br.readLine();
  46.             child=Integer.parseInt(child1);
  47.             System.out.print("THEME PARK: 1 : WATER PARK  2 : SAFARI PARK");
  48.         type1= br.readLine();
  49.         type= Integer.parseInt(type1);
  50.             switch(type)
  51.         {
  52.             case 1:
  53.             System.out.println("");
  54.             System.out.println("\t\t\t\t[ WATER PARK ]");
  55.  
  56.             double adult_customer=adult*water_park_adult;
  57.             double children_customer=child*water_park_children;
  58.             double total=adult_customer+children_customer;
  59.             double discount=total*0.1;
  60.             double total_overall=total-discount;
  61.             int i=adult+child;
  62.  
  63.            
  64.             System.out.println("Category    : Water Park ");
  65.             System.out.println("Total Fee Adult    : RM " +adult_customer);
  66.             System.out.println("Total Feee Children : RM " +children_customer);
  67.             System.out.println("Total       : RM " +total);
  68.             System.out.println("");
  69.             System.out.println("You want to continue: ? ");
  70.             System.out.println("1 : YES |  0: NO ");
  71.             type1= br.readLine();
  72.             type= Integer.parseInt(type1);
  73.             switch(type)
  74.             {
  75.             case 1:
  76.                     if(i=6;i>=6;i++)
  77.                     System.out.println("DISCOUNT RATE: RM " +discount);                    
  78.             break;
  79.                
  80.                 default:
  81.                 System.out.println("NO DISCOUNT");
  82.             }
  83.             System.out.println("Total: RM " +total_overall);
  84.             System.out.println("THANK YOU FOR JOINING US!");
  85.            
  86.             break;
  87.            
  88.  
  89.  
  90.             case 2:
  91.                 System.out.println("");
  92.                 System.out.println("\t\t\t\t[ SAFARI PARK ]");
  93.                 double adult_customer_safari=adult*safari_park_adult;
  94.                 double children_customer_safari=child*safari_park_children;
  95.                 double total_overall_safari=adult_customer_safari+children_customer_safari;
  96.                 /* TOTAL FARE ETS END */
  97.                 System.out.println("Category      : " +type + "= SAFARI PARK ");
  98.                 System.out.println("Total Fee Adult    : RM " +adult_customer_safari);
  99.                 System.out.println("Total Fee Children : RM " +children_customer_safari);
  100.                 System.out.println("Overall Total       : RM " +total_overall_safari);
  101.                 System.out.println("");
  102.                 System.out.println("You want to continue:  ");
  103.                 System.out.println("1 : YES |  0: NO ");
  104.                 break;
  105.                
  106.                 default:
  107.                 System.out.println("Wrong Option");
  108.  
  109.            
  110.         }
  111.     }
  112. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top