We revert the changes to our final commit last time due to some minor bug on the switch statement. Whenever we select the number 4 which is the check balance after successfully creating an account, the output always prompting to be null! in the Account name whenever checking the personal Account balance.
📫 Solution to the error
private static void createNewAccount(Scanner scanner) {
if (accountCount >= MAX_ACCOUNTS) {
System.out.println("Maximum account limit reached.");
return;
}
System.out.print("Enter Account Name: ");
String accountName = scanner.next();
accountNames[accountCount] = accountName;
accountNumbers[accountCount] = accountCount - 1; // Assign the current accountCount - 1 as the account number
balances[accountCount] = 0.0;
accountCount++;
System.out.println("Account created successfully. Your account number is: " + (accountCount - 1));
}
🌱 This will be our final solution for now for our major changes
We revert the changes to our final commit last time due to some minor bug on the switch statement. Whenever we select the number 4 which is the check balance after successfully creating an account, the output always prompting to be null! in the Account name whenever checking the personal Account balance.
📫 Solution to the error
🌱 This will be our final solution for now for our major changes