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"); } } }

24th Apr 2020, 3:30 PM
BG Mot
BG Mot - avatar
1 Antwort
+ 2
It's loss not lost. That's the reason for failing of test case. The program is correct.
24th Apr 2020, 4:19 PM
SATHISH SINGARABOINA
SATHISH SINGARABOINA - avatar