0
Hovercraft factory.
Tests 3 and 4 are not passed. What is wrong? import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int soldHovercraft = sc.nextInt(); int oneMonthLoss = 21_000_000; int oneMonthIncome = (3_000_000 * soldHovercraft) - oneMonthLoss; if (oneMonthIncome < 0) { System.out.println("Lost"); } else if (oneMonthIncome > 0) { System.out.println("Profit"); } else{ System.out.println("Broke Even"); } } }
1 Resposta
+ 2
It's loss not lost. That's the reason for failing of test case. The program is correct.