Loading...
Loading...
Loading...
A banking app shows a short status line under the account balance. If the balance is above zero it shows In credit. If it is below zero (the account used an overdraft) it shows Overdrawn. If it is exactly zero it shows Zero balance.
Read the balance and print the status line.
In credit, Overdrawn or Zero balance.Example 1
Input
2500
Output
In credit
2500 is above zero.
Example 2
Input
-340
Output
Overdrawn
A negative balance means the account is overdrawn.
Try the problem first. Open one hint at a time.
There are three cases, so you need an if, an else-if and an else.
Test balance > 0 first, then balance < 0. Whatever is left must be zero.
Write your Java code, run it on the examples and submit it to hidden tests.
Solve in the editor