Advertisement
todor_boichev

Untitled

Sep 20th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.76 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Proba {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         double movieBudget = Double.parseDouble(scanner.nextLine());
  7.         int statisti = Integer.parseInt(scanner.nextLine());
  8.         double priceDress = Double.parseDouble(scanner.nextLine());
  9.  
  10.         double priceDekor = movieBudget * 0.10;
  11.         double totalPriceDress = statisti * priceDress;
  12.  
  13.         if (statisti < 150){
  14.             double totalMovieBudget = priceDekor + totalPriceDress;
  15.  
  16.             if (totalMovieBudget < movieBudget){
  17.                 double sumLeft = movieBudget - totalMovieBudget;
  18.                 System.out.printf("Action!%n" +
  19.                         "Wingard starts filming with %.2f leva left.", sumLeft);
  20.  
  21.             }else {
  22.                 double sumEnoght = totalMovieBudget - movieBudget;
  23.                 System.out.printf("Not enough money!%n" +
  24.                         "Wingard needs %.2f leva more.", sumEnoght);
  25.  
  26.             }
  27.         }
  28.         if (statisti > 150){
  29.             double discount = totalPriceDress * 0.10;
  30.             double totalDiscountPriceDress = totalPriceDress - discount;
  31.             double totalMovieBudget = priceDekor + totalDiscountPriceDress;
  32.  
  33.             if (totalMovieBudget <= movieBudget){
  34.                 double sumLeft = movieBudget - totalMovieBudget;
  35.                 System.out.printf("Action!%n" +
  36.                         "Wingard starts filming with %.2f leva left.", sumLeft);
  37.  
  38.             }else {
  39.                 double sumEnoght = totalMovieBudget - movieBudget;
  40.                 System.out.printf("Not enough money!%n" +
  41.                         "Wingard needs %.2f leva more.", sumEnoght);
  42.  
  43.             }
  44.         }
  45.  
  46.  
  47.     }
  48. }
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement