Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final revision of the project #9

Open
flexycode opened this issue Mar 6, 2024 · 0 comments
Open

Final revision of the project #9

flexycode opened this issue Mar 6, 2024 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested

Comments

@flexycode
Copy link
Owner

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

@flexycode flexycode added documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested labels Mar 6, 2024
@flexycode flexycode self-assigned this Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant