Judge 60/10 Toy Shop
Моля за помощ, къде е грешката в IntelliJ нямам проблем с условията.
import java.util.Scanner; public class ToyShop { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double priceExcursion = Double.parseDouble(scanner.nextLine()); int puzzle = Integer.parseInt(scanner.nextLine()); int talkingDolls = Integer.parseInt(scanner.nextLine()); int teddyBears = Integer.parseInt(scanner.nextLine()); int minions = Integer.parseInt(scanner.nextLine()); int tracks = Integer.parseInt(scanner.nextLine()); double totalPuzzle = puzzle * 2.60; double totalTalkingDolls = talkingDolls * 3; double totalTeddyBears = teddyBears * 4.10; double totalMinions = minions * 8.20; double totalTracks = tracks * 2; int totalOrder = puzzle + talkingDolls + teddyBears + minions + tracks; double totalSale = totalPuzzle + totalTalkingDolls + totalTeddyBears + totalMinions + totalTracks; if(totalOrder>=50) { double discount = totalSale * 0.25; double profit = totalSale - discount; double rent = profit * 0.10; double ebitda = profit - rent; double check=ebitda-priceExcursion; System.out.printf("Yes!"+" " + "%.2f",check); System.out.print(" lv left."); } if(totalOrder<50){ double rent=totalSale*0.10; double ebitda=totalSale-rent; double check=priceExcursion-ebitda; System.out.printf("Not enough money!"+" " + "%.2f",check); System.out.print(" lv needed."); } } }
Благодаря, преди да видя отговора ти го направих така и всичко е окей :)