SHARE
TWEET

Untitled

a guest Feb 27th, 2020 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class IZpit {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         double budget = Double.parseDouble(scanner.nextLine());
  7.         String typeOfBillet = scanner.nextLine();
  8.         int countPeople = Integer.parseInt(scanner.nextLine());
  9.  
  10.  
  11.  
  12.         if(countPeople >= 1 && countPeople <=4){
  13.             budget = budget - 0.75 * budget;
  14.         }else if(countPeople >= 5 && countPeople <= 9){
  15.             budget =budget - 0.60 * budget;
  16.  
  17.         }else if (countPeople >= 10 && countPeople <= 24){
  18.             budget = budget - 0.50 * budget;
  19.  
  20.         }else if(countPeople >= 25 && countPeople <= 49){
  21.             budget = budget - 0.40 * budget;
  22.  
  23.         } else {
  24.             budget = budget - 0.25 * budget;
  25.         }
  26.         double normal = 249.99 * countPeople;
  27.         double vip = 499.99 * countPeople;
  28.       if(typeOfBillet.equals("Normal")){
  29.  
  30.  
  31.         if(normal < budget  ) {
  32.  
  33.             double priceleft = budget - normal;
  34.             System.out.printf("Yes! You have %.2f leva left.", priceleft);
  35.         }
  36.  
  37.         }
  38.         if(typeOfBillet.equals("VIP")) {
  39.  
  40.  
  41.             if (vip > budget) {
  42.  
  43.                 double need = vip - budget;
  44.  
  45.                 System.out.printf("Not enough money! You need %.2f leva.", need);
  46.             }
  47.         }
  48.  
  49.  
  50.  
  51.     }
  52. }
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
Top