Traqn Dimitrov

Nqkoi ako moje da pomogne kade mi e greshkata?


 Scanner scan = new Scanner(System.in);

        String input = scan.nextLine();

        double accountAmount = 0.0;

        while (!input.equals("NoMoreMoney")) {

            double sum = Double.parseDouble(input);

            if (sum < 0) {
                System.out.println("Invalid operation!");
                break;
            }

                System.out.printf("Increase: %.2f%n", accountAmount);
                accountAmount += sum;

                input = scan.nextLine();

        }
        System.out.printf("Total: %.2f", accountAmount);
    }
}