javaBasics
package exer; import java.util.Scanner; public class FischLand { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double priceMackerel = Double.parseDouble(scanner.nextLine()); double priceSprinkle = Double.parseDouble(scanner.nextLine()); double kilogramsOfBonito = Double.parseDouble(scanner.nextLine()); double kilogramsOfSaffron = Double.parseDouble(scanner.nextLine()); double kilogramsOfMussels = Double.parseDouble(scanner.nextLine()); double priceOfBonito = priceMackerel + priceMackerel * 0.60 ; double priceOfSaffron = priceSprinkle + priceSprinkle * 0.80 ; double priceOfMussels = kilogramsOfMussels * 7.5; double sum = kilogramsOfBonito * priceOfBonito + kilogramsOfSaffron * priceOfSaffron + kilogramsOfMussels * priceOfMussels; System.out.printf("%.2f",sum); } }
Моля някой да ми помогне да открия проблема на този код .Задачата е fishLand,от More Exercises. приема два от входовете.Но на третия ми дава невярна стойност.