Write a very simple data maintenance java program for a bank

Assignment Help Data Structure & Algorithms
Reference no: EM131208260

Array and Selection Sort

Please remember to read and follow the assignment requirements.

In this assignment, you will write a very simple data maintenance Java program for a bank. Some of the techniques used (arrays as data structures, selection sort) will be review from cosc1047, while others (searching) will be the material you are now covering (or you have learned). This program will likely be physically longer than you have written so far, so remember do implement it in a modular fashion- do a proper program design even though you don't have to hand your design in. Also remember to START THIS ASSIGNMENT SOON. DO NOT leave it until the last minute!

John's 24-Hour Bank and 1-Hour Dry Cleaning is a new institution that has just begun to offer banking (and cleaning!) services to the University community. Your program will (thankfully) deal with only the banking end of the business. Every client of the bank has a customer number, and can have several types of accounts: checking, savings, and mutual funds. The bank will store a record for each account consisting of a customer number (an integer) representing the owner of the account, an account type (a single char: C for chequing, S for savings, and M for mutual fund), and the balance of the account (a double). These are kept in three arrays-an array of customer numbers, an array of types, and an array of balances.

A sample of what this might look like appears below:

Customer Array

Type Array

Balance Array

102241

C

1.29

992944

S

22.50

992944

C

1.24

The entries in the array correspond to one another-for example, the first slot in all three arrays represent the fact that customer number 102241 has a chequing account with $1.29 in it. As is shown, the same customer number can appear several times, as customers can have more than one account. These are called parallel arrays, because the slots in each correspond, and the really important thing about parallel arrays is that if you shuffle around anything in one array, you have to perform the same shuffles to the others. For example, say we delete one particular account. If we remove the entry from the customer array, but not the others, nothing matches any more and the data is worthless.

Similarly, if we sort by balance, every data movement in the balance array must be duplicated in the others precisely, or once again the correspondence is lost. Since the array entries correspond to one another, we also need only keep track of the size (the number of entries used) once, since there will be the same number of entries in all three arrays.

Your banking system will not do terribly much (by banking system standards!). When you start the program, it will look for a text file called bank.txt, open it, and load the three arrays with the data contained there. You can assume that bank.txt will contain one entry per line- the first customer number, then the account type on the next line, and the balance on the next line, then the next customer number, and so on. The data will not be in any particular order, but you can assume all data for each account will be present (that is, there'll be no unmatching balances, etc.), and that the data will be error-free.

Your bank will hold a maximum of 200 accounts, but you do NOT know how many will be in the file (you'll have to count them as you read and keep track of the sizes of arrays).

Once you have the data read in, you will prompt the user on the screen to enter commands (single characters). We will ignore the usual database update commands (creating, deleting accounts, etc), and concentrate only on selecting and viewing data. The valid commands your system will support are S (Search for an account), P (Print Total Balances), and Q (quit). You should error check these to ensure that other letters are not accepted (just print an error message in such cases and prompt for the command again). Your system will accept S and P commands until eventually the user enters a Quit command, causing the program to terminate.

When processing the Print Total Balances command, you will need to first ensure that the arrays representing the accounts are sorted by customer number so that all accounts for a particular customer appear together. Print Total Balances should thus begin by calling a Selection Sort method that you must write. You will have to slightly alter the one you saw in class, because you are using parallel arrays here. Remember, you have to keep the correspondence between slots: this means that while you're sorting the customer numbers, you will have to perform identical swaps in all three arrays. After the array has been sorted, Print Total Balances will print ONE entry for each customer showing the TOTAL of ALL the accounts that customer has. You must only go through the arrays ONCE to do this, which shouldn't at all be a problem once the data's sorted.

A Search command will allow the user to search for an account by account number, type, or both. The routine to process a search command will prompt the user for a customer number and account type. The user can either enter a valid value for these, or enter 0 for an account number or X for an account type. An account number of 0 or an account type of X will be considered a "don't care" on the user's part, allowing the search routine to display multiple results. For example, searching for an account of 12345 and an account type of X will cause ALL accounts for customer number 12345 to be displayed, regardless of the type of account. If they entered 12345 and C, it would only display the chequing account, if there were one. Similarly, a 0 for an account number, and an account type of S would cause ALL savings to be displayed. A single search command should only go through the arrays ONCE, and you should not sort or otherwise re-arrange the arrays.

Data returned by a search or Print Total Balances should be displayed in a table format, showing the fields from all three arrays (that is, the customer number, account type, and balance for all "found" account entries). For a search, if no data is found, simply display a message indicating that. In general, data should be nicely formatted and columns should be labeled appropriately.

You do not need to have a GUI for your program.

Show your program to TA before or on due date, and hand in (at the same time) a printed copy of your program and the output of your program, using the test data posted on the website.

Attachment:- Assignment.rar

Verified Expert

This assignment highlight the use of the selection sort algorithm and file operation like reading the data from the file. It is resented with the BankScreenShot.docx file which contains all the screenshot of the required functionality. It read the bank data from the bank.txt file and store them in the respective array. It provide the user the functionality like Search for the account and the Print Total Balance for each customer.

Reference no: EM131208260

Questions Cloud

Write a paper formulating a thesis : Write a paper and need help/ideas formulating a thesis that goes above and beyond answer the prompt and provides a unique avenue for analysis.
Determine the information rate in bits per second : The resulting messages are encoded using a binary Huffman code. Assuming that 250 samples of the source are transmitted each second, determine the resulting binary symbol rate in symbols per second. Also determine the information rate in bits per ..
Payment of maturing liabilities interest and dividends : Discuss the following statment in your own words in detail:"Creditors and stockholders are reluctant to invest money in a company that does not generate enough cash from operating activities to assure prompt payment of maturing liabilities, interest ..
User-centred approach to design identified : Please just take ten minutes to write about the potential benefits of taking a user-centred approach to design. Please outline three of the benefits of a user-centred approach to design identified in the first activity.
Write a very simple data maintenance java program for a bank : COSC 2006 -Data Structures - Show your program to TA before or on due date, and hand in (at the same time) a printed copy of your program and the output of your program, using the test data posted on the website.
In addition to the standard data hierarchy : In addition to the standard data hierarchy, an Interactive Analytics database contains: Lookup tables Tables containing data related to queries) Tables for storing custom data Each table has multiple records - entries into the table itself. Can you p..
Describe intersectionality and discuss its major components : Describe how perspectives of same-sex desire changed from ancient civilizations, to the 1880s, and through WWI. How was same-sex desire and activity thought about in ancient Greece? What was accepted and permissible? What wasn't? What examples of ..
Predict the most significant ethical issue : Rate the three (3) most important concepts that you learned in this course in order of importance (one [1] being the most important). Propose two (2) applications of this knowledge in your current or a future position.
Briefly determine demographics or eligibility requirements : Briefly determine the demographics/eligibility requirements of the participants you would seek for the proposed study. Research design (good models for this are the 'methods' sections of empirical research papers that include 'participants' 'researc..

Reviews

len1208260

9/16/2016 1:37:38 AM

This assignment must be done in eclipse (please use a basic java codes to solve the program) it explained in the files attached also I attached the data file that need to be used in the program

Write a Review

Data Structure & Algorithms Questions & Answers

  Dbms and data mining to imporve customer service

Discuss how a database management system and data mining can help motor vehicle maintenance center improve its services, and what tables would be required in such a database.

  Write computer program to implement algorithm

Write computer program to implement algorithm and demonstrate the results and what is the machine run time in second for sorting array A?

  Currency conversion developmentapplication-level

currency conversion developmentapplication-level requirements list1. the program will prompt the user for data input of

  Algorithm devise a test plan that will ruthlessly locate

Explain using text and diagrams how your algorithm works. Imagine that you later leave the software company producing the bespoke spread sheets and a new scripter takes over your work. If you were that new scripter what information would you find ess..

  Provide polynomial-time algorithm to decide in graph

Provide a polynomial-time algorithm to decide whether G has unique minimum s - t cut (i.e., an s - t cut of capacity strictly less than that of all other s - t cuts).

  Develop a flowchart and provide a brief explanation for it

A middle school has decided that it would like to make its students' grades available to their parents via an online parent portal. Develop a flowchart and provide a brief explanation for it

  Give the steps to build priority queue in heap structure

Both are given from a paper assignment both are Logic questions. I don't need ANY CODE AT ALL. Just the general steps you would use.

  Explain the structure and associated algorithms

Explain the structure and associated algorithms. More about trees (splay, red-black, AA, skip lists, k-d trees, etc). Amortized algorithm analysis. Huffman codes and More about graphs.

  System administrators database, network and application

What methods would you use to effectively manage a team of system administrators database, network, application working in your data center?

  Analyze the algorithm and print the result

Suppose a maximum flow for G has been computed, but an edge is now removed form E. Describe how the maximum flow can be efficiently updated. Analyze your algorithm.

  Write a pseudocode for divide-and-conquer algorithm

Write a pseudocode for divide-and-conquer algorithm for finding the position of the largest element in an array of n numbers

  Explain sorting algorithm which is optimal in cost

Explain a sorting algorithm which is optimal with respect to this cost model and uses O(n) space. That is, time used by algorithm should exactly match lower bound

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd