Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class GodzillaKong_2 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double movieBudget = Double.parseDouble(scanner.nextLine());
- int actors = Integer.parseInt(scanner.nextLine());
- double clothes = Double.parseDouble(scanner.nextLine());
- double decorPrice = movieBudget / 10;
- double clothPrice = actors * clothes;
- if (actors > 150){
- double discount = clothPrice / 10;
- clothPrice = clothPrice - discount;
- }
- double totalMoviePrice = decorPrice + clothPrice;
- double moneyLeft = movieBudget - totalMoviePrice;
- if (totalMoviePrice <= movieBudget){ //here
- System.out.print("Action!");
- System.out.printf("%nWingard starts filming with %.2f leva left.", moneyLeft);
- }
- else if (movieBudget < totalMoviePrice){//Ето тук прави проблем //here
- System.out.print("Not enough money!");
- System.out.printf("%nWingard needs %.2f leva more.", moneyLeft * -1); //here
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement