02.Christmas Market 90/100,last test error.
Опитах всичко да променя и в крайна сметка винаги дава 90/100,ето и кода,ако някой може да ми обясни защо не става работата ще съм благодарен.
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double moneyNeeded=Double.parseDouble(scanner.nextLine()); double fictionBooks=Double.parseDouble(scanner.nextLine()); double thrillerBooks=Double.parseDouble(scanner.nextLine()); double romanceBooks=Double.parseDouble(scanner.nextLine()); double fictionBooksPrice=14.90; double thrillerBooksPrice=9.80; double romanceBooksPrice=4.30; double totalSum=(thrillerBooks*thrillerBooksPrice)+(fictionBooks*fictionBooksPrice)+(romanceBooks*romanceBooksPrice); double totalsumDDS=totalSum-totalSum*0.20; if (moneyNeeded<0){ System.exit(0); } if (totalSum>=moneyNeeded){ double totalBonus= totalsumDDS-moneyNeeded; double bonus=Math.floor(totalBonus-totalBonus*0.90); int i=(int)bonus; double donationBonus=totalBonus-bonus; double totalDonated=moneyNeeded+donationBonus; System.out.printf("%.2f leva donated.%n",totalDonated); System.out.printf("Sellers will receive %d leva.",(i)); }else{ System.out.printf("%.2f money needed.",moneyNeeded-totalsumDDS ); } } }