The goal of this assignment is for you to practice file input and output, arrays, and methods. This assignment is very similar to what we did in lab since it is possible that we won’t have time to finish in class. However pay close attention as there are differences!
The application you are writing will support the creation of new bank accounts. Specifically it will make sure that a proposed new bank account number does not already exist (which it will determine by looking at the existing account numbers in a text file called accountsFile.txt) and will add the new number to accountsFile.txt. (10 points) Please note that for this assignment, the user should be asked if he/she wants to enter another new account after the first one. He/she should be able to add as many accounts as he/she wants.
We want to be able to deal with multiple account numbers stored in the same file, and we want to be able to read them all into our application to avoid going back and forth between the application and the file. To do so we need to create an array of Strings which will eventually be filled with all the existing account numbers. Please note that for this assignment you cannot count on a separate file containing the total number of bank accounts. You will have to calculate the total number of accounts in some other way since you can only use the file accountsFile.txt containing the list of all account numbers currently used.
(20 points!) Write the JEnglish for a modification of the ATM.java program that will perform the operations listed below. Make sure you include in your JEnglish a full description of the methods you will need. You’ve already done some of this work in class, and we discussed nearly all of it. You should take this opportunity to think about making good use of your JEnglish. Remember that JEnglish is NOT about making your teacher happy! It may seem that way, be believe me, really thinking out what you are trying to accomplish, each specific step of it, makes your coding a lot easier, cleaner and WILL ultimately save you time. For full points, your description of the exact purpose each method must also be clearly specified.
Review the slide from my notes where I showed you my version of the main() method and you should get an idea of how you might break the steps up into methods that will achieve the steps described below. Not every one of these has to be an individual method—although it’s pretty close. Still, how you organize it is ultimately up to you.
You should structure your JEnglish to mimic the final program, including a list of "method calls" on top and details about each method at the bottom. For each method, write some details about what parameters it will need, what if any value it will return, and clearly specify what the method actually does. Again, not about making teacher happy. It’s about saving student time!
(5 points) The main() method: Your main method needs to be very short. It should be a handful of method calls and possibly a loop (again, see my version of main() from the class slides). You have some freedom on how you implement the solution; however, you should create at least the four methods listed below. If your solution requires you to change the parameters slightly, you can do that, but make sure you read through and can handle Item 5 below by changing only one or two lines of code.
(5 points) Create a short ReadMe Word or text file (ReadMe.doc or ReadMe.txt) containing the following information:
There are 10 points not accounted for in the point totals listed above. These points are for miscellaneous aspects like following submission instructions, naming variables properly, commenting your code, formatting your code effectively, etc.
As always, you must submit the assignment using the online homework submission system on the COL site. Create a .zip file with the necessary documents from each part of the assignment and upload this file to the COL site. The .zip file should be called yourLastName.zip where yourLastName is your last name and should contain the following items:
Be warned that even if you include text files that you used for testing, I am likely to use my own text files when running your program. Make sure that you stick to the format discussed here since a program that crashes or malfunctions when I run it on a text file following the assumed format will not earn full credit.
Late assignments are NOT accepted for this assignment.