Strings a, b, and c contain the valid account numbers and passwords. Public static String checkID(String acctNum, String pwd) If the account information is invalid, the method returns the string "error". is valid, the method returns the current account balance, as a string. and pwd is the correct password for the account. The checkID method determines if acctNum is a valid account number Public static Scanner kbd = new Scanner(System.in) Perhaps incorporating a boolean true/false statement. I'm sure there are going to be quite a bit of suggestions and feedback, but to start it off I'm looking the do while loop in the main program, and feel that the logic can be simplified such that the first or even second if statements can place outside of the loop as I feel that using all 3 can be redundant. As I'm looking at the code a year later, and gained a bit more experience, I see where it could have been improved. First off, this was a project I worked on when I started getting into Java last summer and had an assignment that required us to write a simple ATM application. This is not much of a question as more of an practice/experience project and feedback request.
0 Comments
Leave a Reply. |