Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.67 KB | None | 0 0
  1. package FirstDay;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Practice_Vacation {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.  
  10.         double people = Double.parseDouble(scanner.nextLine());
  11.         String groupType = scanner.nextLine();
  12.         String day = scanner.nextLine();
  13.         double total = 0;
  14.         if(groupType.equals("Students")){
  15.             if(day.equals("Friday")){
  16.             total+=people*8.45;
  17.             }else if(day.equals("Saturday")){
  18.                 total+=people*9.8;
  19.             }else if(day.equals("Sunday")){
  20.                 total+=people*10.46;
  21.             }
  22.             if(people >= 30){
  23.                 total=total- total*0.15;
  24.             }
  25.         }else if (groupType.equals("Business")){
  26.             if(day.equals("Friday")){
  27.                 total+=people*10.9;
  28.             }else if(day.equals("Saturday")){
  29.                 total+=people*15.6;
  30.             }else if(day.equals("Sunday")){
  31.                 total+=people*16;
  32.             }
  33.             if(people >= 100){
  34.                 double discount = total / people;
  35.                 discount = discount*10;
  36.                 total=total-discount;
  37.             }
  38.  
  39.         }else if (groupType.equals("Regular")){
  40.             if(day.equals("Friday")){
  41.                 total+=people*15;
  42.             }else if(day.equals("Saturday")){
  43.                 total+=people*20;
  44.             }else if(day.equals("Sunday")){
  45.                 total+=people*22.5;
  46.             }
  47.             if(people >= 10&& people<=20){
  48.                total-=total*0.05;
  49.             }
  50.  
  51.         }
  52.         System.out.printf("Total price: %.2f",total);
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement