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

  Define difference between algorithm and heuristic

Please explain in detail the Difference Between the following terms Algorithm and Heuristic

  Which is a role of data mining agents

Which of the following software is cost effective since the vendor that builds the application spreads out the development costs by selling copies to a large number of users?

  Creation myths from different cultures

Write a 700- to 1,050-word paper about two creation myths from the attached readings that address the following. Pick at least two creation myths from two different cultures. For ideas, refer to this week's readings. These should be specific storie..

  Addition and subtraction of numbers in binary

Addition and Subtraction of numbers in binary and round to the nearest decimal number with three significant decimal digits

  Developing an eer model

Construct an EER model for the given situation using the traditional EER notation, the Visio notation or the supertypes notation.

  Evaluate the time complexity of algorithm

You will be designing a non-member function that accepts as its argument one dynamic bag object (header file found in figure 4.9).  This function will return a reference to a new dynamic bag object.

  Sequential logic structures-flowchart or pseudocode

Document the steps for the logic structure to capture the payment information. This can be done as either a flowchart or pseudocode. Be sure to include inputs, variable declarations and assignments, and outputs.

  Draw flowchart to print average for each student

Draw a flowchart to print the average for each student in a class. Input. Input consists of student records each containing a student's name(STUDENT-NAME), score for first test(TEST), score for second test(TEST2), and score for third test(TEST3)..

  Write algorithm using pseudocode to recognize substrings

Write the algorithm, using pseudocode, to do the following task, Given the string of numbers, recognize all the substrings which form numbers which are divisible by 3.

  Describe ambiguity in proposed algorithm

Describe the distinction between an ambiguity in a proposed algorithm and an ambiguity in the representation of an algorithm. Describe how the use of primitives helps remove ambiguities in an algorithm's representation.

  Design a recursive algorithm to implement

Design a recursive algorithm to implement this specification. That is, the body of FindLast should contain a recursive call FindLast(A,..,..).

  Describe the worst case scenario for quick sort algorithm.

Any ideas to improve the worst case? Comment on the improvement in running time vs. increase in code complexity.

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