deyanivanov966

06. Godzilla vs. Kong

Aug 23rd, 2020 (edited)
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1. import java.sql.SQLOutput;
  2. import java.util.Scanner;
  3.  
  4. public class GodzillavsKong {
  5.     public static void main(String[] args) {
  6.         Scanner scanner = new Scanner(System.in);
  7.  
  8.         double A = Double.parseDouble(scanner.nextLine());
  9.         int B = Integer.parseInt(scanner.nextLine());
  10.         double C = Double.parseDouble(scanner.nextLine());
  11.  
  12.         double D = B*C;
  13.         double E = (A/100)*10;
  14.  
  15.         if (B>=150){
  16.             D=D*0.9;
  17.         }
  18.  
  19.         double F = E+D;
  20.  
  21.         if (A<F){
  22.             System.out.println("Not enough money!");
  23.             System.out.printf(" Wingard needs %.2f leva more.",F-A);
  24.  
  25.         }else if (A>=F){
  26.             System.out.println("Action! ");
  27.             System.out.printf("Wingard starts filming with %.2f leva left.",A-F);
  28.         }
  29.  
  30.     }
  31. }
  32.  
Add Comment
Please, Sign In to add comment