import [Link].
Scanner;
public class BankingApp {
public static void main(String[] args) {
Scanner scanner = new Scanner([Link]);
double balance = 0.0;
int choice;
while (true) {
[Link]("\n=== Banking Application Menu ===");
[Link]("1. Check Balance");
[Link]("2. Deposit Money");
[Link]("3. Withdraw Money");
[Link]("4. Exit");
[Link]("Enter your choice: ");
if (![Link]()) {
[Link]("Invalid input. Please enter a number between 1
and 4.");
[Link](); // Clear invalid input
continue;
}
choice = [Link]();
switch (choice) {
case 1:
[Link]("Your current balance is: $%.2f\n", balance);
break;
case 2:
[Link]("Enter amount to deposit: $");
double depositAmount = [Link]();
if (depositAmount < 0) {
[Link]("Deposit amount cannot be negative.");
} else {
balance += depositAmount;
[Link]("$%.2f deposited successfully. New
balance: $%.2f\n", depositAmount, balance);
}
break;
case 3:
[Link]("Enter the amount to withdraw: $");
double withdrawAmount = [Link]();
if (withdrawAmount < 0) {
[Link]("Withdrawal amount cannot be
negative.");
} else if (withdrawAmount > balance) {
[Link]("Insufficient balance.");
} else {
balance -= withdrawAmount;
[Link]("$%.2f withdrawn successfully. New
balance: $%.2f\n", withdrawAmount, balance);
}
break;
case 4:
[Link]("Thank you for using our banking
application. Goodbye!");
[Link]();
return; // exit the program
default:
[Link]("Invalid choice. Please select a number
between 1 and 4.");
}
}
}
}