Advertisement
Guest User

Untitled

a guest
Apr 9th, 2019
555
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.99 KB | None | 0 0
  1. package Mess;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Godzilla {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         double movieBudget = Double.parseDouble(scanner.nextLine());
  9.         int statistCount = Integer.parseInt(scanner.nextLine());
  10.         double dressPrice = Double.parseDouble(scanner.nextLine());
  11.         double sum = 0;
  12.         double decor = movieBudget * 0.1;
  13.         double dressTotal = statistCount * dressPrice;
  14.         if (statistCount > 150) {
  15.             dressTotal = dressTotal - (dressTotal * 0.10);
  16.         }
  17.         sum = decor + dressTotal;
  18.         double diff = Math.abs(movieBudget - sum);
  19.         if (movieBudget > sum) {
  20.             System.out.println("Action!");
  21.             System.out.printf("Wingard starts filming with %.2f leva left.",diff);
  22.         }else {
  23.             System.out.println("Not enough money!");
  24.             System.out.printf("Wingard needs %.2f leva more.", diff);
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement