Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pack1;
- import java.io.*;
- public class Class1
- {
- public void show ()throws IOException
- {
- InputStreamReader r=new InputStreamReader(System.in);
- BufferedReader br=new BufferedReader(r);
- String type1;
- int type;
- String num_pass1;
- int num_pass;
- String adult1;
- int adult;
- String child1;
- int child;
- /* START WATER PARK FARE*/
- double water_park_adult=26.00;
- double water_park_children=16.00;
- /* END WATER PARK FARE */
- /* START ETS FARE*/
- double safari_park_adult=36.00;
- double safari_park_children=26.00;
- /* END ETS FARE */
- /* SYSTEM START */
- System.out.println("");
- System.out.println("***BUKIT GAMBANG RESORT CITY THEME PARK***");
- System.out.println("");
- System.out.print("Enter number of CUSTOMER : ");
- num_pass1= br.readLine();
- num_pass=Integer.parseInt(num_pass1);
- System.out.print("ADULT : ");
- adult1= br.readLine();
- adult=Integer.parseInt(adult1);
- System.out.print("CHILD : ");
- child1= br.readLine();
- child=Integer.parseInt(child1);
- System.out.print("THEME PARK: 1 : WATER PARK 2 : SAFARI PARK");
- type1= br.readLine();
- type= Integer.parseInt(type1);
- switch(type)
- {
- case 1:
- System.out.println("");
- System.out.println("\t\t\t\t[ WATER PARK ]");
- double adult_customer=adult*water_park_adult;
- double children_customer=child*water_park_children;
- double total=adult_customer+children_customer;
- double discount=total*0.1;
- double total_overall=total-discount;
- int i=adult+child;
- System.out.println("Category : Water Park ");
- System.out.println("Total Fee Adult : RM " +adult_customer);
- System.out.println("Total Feee Children : RM " +children_customer);
- System.out.println("Total : RM " +total);
- System.out.println("");
- System.out.println("You want to continue: ? ");
- System.out.println("1 : YES | 0: NO ");
- type1= br.readLine();
- type= Integer.parseInt(type1);
- switch(type)
- {
- case 1:
- if(i=6;i>=6;i++)
- System.out.println("DISCOUNT RATE: RM " +discount);
- break;
- default:
- System.out.println("NO DISCOUNT");
- }
- System.out.println("Total: RM " +total_overall);
- System.out.println("THANK YOU FOR JOINING US!");
- break;
- case 2:
- System.out.println("");
- System.out.println("\t\t\t\t[ SAFARI PARK ]");
- double adult_customer_safari=adult*safari_park_adult;
- double children_customer_safari=child*safari_park_children;
- double total_overall_safari=adult_customer_safari+children_customer_safari;
- /* TOTAL FARE ETS END */
- System.out.println("Category : " +type + "= SAFARI PARK ");
- System.out.println("Total Fee Adult : RM " +adult_customer_safari);
- System.out.println("Total Fee Children : RM " +children_customer_safari);
- System.out.println("Overall Total : RM " +total_overall_safari);
- System.out.println("");
- System.out.println("You want to continue: ");
- System.out.println("1 : YES | 0: NO ");
- break;
- default:
- System.out.println("Wrong Option");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement