Me siento muy bien porque pude desarrollar este desafío por mi misma. Mi solución fue la siguiente:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
String name = "Tony Stark";
String accountType = "Checking";
double balance = 1599.99;
int option = 0;
double amountWithdrawal = 0;
double amountDeposit = 0;
Scanner keyboardInput= new Scanner(System.in);
System.out.printf(
"""
**************************************************
Customer name: %s
Account type: %s
Current available balance: $%.2f
"""
, name, accountType, balance);
String menu = """
**************************************************
Enter the number to your desired option
1 - Check my available balance
2 - Withdraw
3 - Deposit
9 - Quit the menu
**************************************************
""";
while (option != 9){
System.out.println(menu);
option = keyboardInput.nextInt();
switch (option) {
case 1:
System.out.println("Your current available balance is " + balance);
break;
case 2:
System.out.println("How much would you like to withdraw?");
amountWithdrawal = keyboardInput.nextDouble();
if (amountWithdrawal > balance) {
System.out.println("Your balance is insufficient for this withdrawal. Avoid overdraft");
} else {
balance -= amountWithdrawal;
System.out.println("Your withdrawal was completed, now your available balance is $" + balance);
}
break;
case 3:
System.out.println("How much would you like to deposit?");
amountDeposit = keyboardInput.nextDouble();
balance += amountWithdrawal;
System.out.println("Your deposit was completed, now your available balance is $" + balance);
break;
case 9:
System.out.println("Thank you for using my system, until next time.");
break;
default:
System.out.println("Invalid option, enter a valid option on the menu.");
}
}
}
}