Assignment The object of this assignment is to construct a mini-banking system that helps us manage...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Assignment The object of this assignment is to construct a mini-banking system that helps us manage banking data. Notice that you can copy and paste your code from previous assignments. This assignment asks you to allow read from/write to file, as well as search and sorting algorithm. The class name should be Checking4, an underscore, and your NetID run together; for example, if your NetID is abcde6, your class name would be Checking4_abcde6. For this assignment, we will create text-based tools for creating, deleting, and sorting checking account objects. All requirements from the previous assignment remain in effect (meaning you should still keep the two data members and three methods from last assignment). The new features for this application are: 1. In the Checking class from last assignment, add a new data member Name, type string, representing customer name. 2. In Checking4_abcde6 class, keep data member to be the same. In the main method, first create five objects in Checking class with the following information. The first object: AccNum: 100, Name: Alice, Balance: 100.00 The second object: AccNum: 120, Name: Bob, Balance: 110.00 The third object: AccNum: 141, Name: Doug, Balance: 90.00 The fourth object: AccNum: 116, Name: Eva, Balance: 100.00 The fifth object: AccNum: 132, Name: Frank, Balance: 80.00 Then store these five objects to AccInfo, data member of this class. The main method will then call the WriteAcc using AccInfo as parameter, and ReadAcc methods below. In the main method, you should call ReadAcc to read the AccInfo.txt file specified below, and assign the returned value to NewAccInfo array. Then this main method should call SortBalance Desc method to sort the NewAccInfo array based on balance in descending order. Then call the SearchBalance method to search a value within NewAccInfo, and display the result of the SearchBalance method. 3. Create a WriteAcc method. This method is a static method, receives a parameter, and the type of this parameter is array of Checking class. This method should write the information stored in objects within the parameter to a delimiter file, separated using comma. Each line in this delimiter file is an object, and comma separates the three fields of an object. Write this file to the work directory of your java code with the name I of an object. Write this file to the work directory of your java code with the name AccInfo.txt 4. Create a ReadAcc method. This method receives a parameter with type String. This string represents the file name in your work directory. In this method, read information contained in the file (corresponding to the parameter value), and generate Checking objects based on the information from the file. This method should return an array with Checking objects. Hint: You can first identify how many objects you need in an array, then create the array. Then read the file and add objects into this array. 5. Create a SortBalance Desc method. This method receives a parameter with array with Checking objects, and return an array with Checking objects. The returned array should be a sorted array with Checking objects, with the value of Balance in descending order. You should adapt the Bubble Sort algorithm from slides in this method. You should also print this array out in console. 6. Create a SearchBalance method. This method receives a parameter with array with Checking objects, and return an array with Checking objects. In addition, this method should also request input from user to specify a Balance value. The returned array should contain objects with user-specified Balance value. You should adapt the Binary Search algorithm from slides in this method. Hint: the binary search method we discuss in class only apply to the scenario in which there are only unique values. For this question, if there are multiple objects with the same search value, it is OK to just return one of them. However, if you want to return all objects with the search value, you need to slightly change the Assignment The object of this assignment is to construct a mini-banking system that helps us manage banking data. Notice that you can copy and paste your code from previous assignments. This assignment asks you to allow read from/write to file, as well as search and sorting algorithm. The class name should be Checking4, an underscore, and your NetID run together; for example, if your NetID is abcde6, your class name would be Checking4_abcde6. For this assignment, we will create text-based tools for creating, deleting, and sorting checking account objects. All requirements from the previous assignment remain in effect (meaning you should still keep the two data members and three methods from last assignment). The new features for this application are: 1. In the Checking class from last assignment, add a new data member Name, type string, representing customer name. 2. In Checking4_abcde6 class, keep data member to be the same. In the main method, first create five objects in Checking class with the following information. The first object: AccNum: 100, Name: Alice, Balance: 100.00 The second object: AccNum: 120, Name: Bob, Balance: 110.00 The third object: AccNum: 141, Name: Doug, Balance: 90.00 The fourth object: AccNum: 116, Name: Eva, Balance: 100.00 The fifth object: AccNum: 132, Name: Frank, Balance: 80.00 Then store these five objects to AccInfo, data member of this class. The main method will then call the WriteAcc using AccInfo as parameter, and ReadAcc methods below. In the main method, you should call ReadAcc to read the AccInfo.txt file specified below, and assign the returned value to NewAccInfo array. Then this main method should call SortBalance Desc method to sort the NewAccInfo array based on balance in descending order. Then call the SearchBalance method to search a value within NewAccInfo, and display the result of the SearchBalance method. 3. Create a WriteAcc method. This method is a static method, receives a parameter, and the type of this parameter is array of Checking class. This method should write the information stored in objects within the parameter to a delimiter file, separated using comma. Each line in this delimiter file is an object, and comma separates the three fields of an object. Write this file to the work directory of your java code with the name I of an object. Write this file to the work directory of your java code with the name AccInfo.txt 4. Create a ReadAcc method. This method receives a parameter with type String. This string represents the file name in your work directory. In this method, read information contained in the file (corresponding to the parameter value), and generate Checking objects based on the information from the file. This method should return an array with Checking objects. Hint: You can first identify how many objects you need in an array, then create the array. Then read the file and add objects into this array. 5. Create a SortBalance Desc method. This method receives a parameter with array with Checking objects, and return an array with Checking objects. The returned array should be a sorted array with Checking objects, with the value of Balance in descending order. You should adapt the Bubble Sort algorithm from slides in this method. You should also print this array out in console. 6. Create a SearchBalance method. This method receives a parameter with array with Checking objects, and return an array with Checking objects. In addition, this method should also request input from user to specify a Balance value. The returned array should contain objects with user-specified Balance value. You should adapt the Binary Search algorithm from slides in this method. Hint: the binary search method we discuss in class only apply to the scenario in which there are only unique values. For this question, if there are multiple objects with the same search value, it is OK to just return one of them. However, if you want to return all objects with the search value, you need to slightly change the
Expert Answer:
Related Book For
Data Modeling and Database Design
ISBN: 978-1285085258
2nd edition
Authors: Narayan S. Umanath, Richard W. Scammel
Posted Date:
Students also viewed these programming questions
-
Case Study: Quick Fix Dental Practice Technology requirements Application must be built using Visual Studio 2019 or Visual Studio 2017, professional or enterprise. The community edition is not...
-
(a) Explain how a limit worth may be tended to at run-time, both in a syntaxtree middle person and in collected code. What is the importance word "settled" already? [3 marks] (b) Give a model program...
-
The figure below represents a schematic of pipe network. A rate of 35 Ls, is pumped to feed two lines (3-4-5-6; and 2-7-8). The length and diameter of each pipe segment are listed in the table....
-
Match each player with the related definition by entering the appropriate letter in the space provided. (1) Financial analyst (2) Creditor (3) Independent auditor (4) Private investor (5) SEC (6)...
-
Julie Langille decided to sell her large recreational vehicle (RV). Considerable portions of the RV floor had suffered termite damage and this, in turn, had led to some rotting. Before dealing with...
-
Granger Technology Solutions, Inc., completed the following transactions during January 2011, its first month of operations: Requirement 1. Record the preceding transactions in the journal of Granger...
-
State whether or not a trust is created in each of the following situations: (a) A declares herself trustee of the bulk of my securities in trust for B. (b) A, the owner of Blackacre, purports to...
-
(10 points) Find the function f(x) described by the given initial value problem. f(x) = f'(x) = 6x, f(4) = 5
-
List supplier id, name, and city of any supplied food with its price is more than a nested query to find food items in the FOOD table that the price are more than Use a subquery or also called a...
-
What is serial nesting? How does it work? Can it be used by hotels? Why or why not? What are the limitations? (10 Marks 2. You are the revenue manager for the Niagara River Lions semi-pro basketball...
-
On January 1 , 2 0 2 5 , Cullumber Company purchased 3 0 % of Ivanhoe Corporation\'s common stock; no goodwill resulted from the purchase. Cullumber appropriately carries this investment at equity...
-
Your brother is sitting next to your female friend, and you are praying he says nothing stupid. Out of his mouth comes "What's your mass, my little friend?" You are mortified, because then he says "I...
-
Describe the different management styles their effects on an IT project and make recommendations for motivating and managing teams, based on a IT project that revolves around migrating a Bank from a...
-
Johnson Inc.s non - strategic investment portfolio at December 3 1 , 2 0 1 9 , consisted of the following: Debt and Equity Investments * Cost Fair Value 1 0 , 0 0 0 Xavier Corp. common shares $ 1 6 3...
-
Jaguar Plastics Company has been operating for three years. At December 31 of last year, the accounting records reflected the following: Cash $27,000 Accounts payable $18,000 Investments (short-term)...
-
26. P(t) b) The number of minnows in a back yard pond is modelled by the equation P(t) Where t is the time in years. [3 marks, 7 marks] Given that P' (t) = = a) Determine P (0) and lim P(t) and...
-
For the following exercises, write the first four terms of the sequence. a n = 2 n 2
-
What information is lost by the use of the information-reducing grammar?
-
Revise the ER diagram drawn in the previous exercise to include the following mandatory attributes: CLIENT- ID number, name, address (city, state, zip), phone number(s), birthdate; AGENT - agent...
-
What is data integrity, and what is the significance of a lack of data integrity?
-
Financial statement data of HiFlite Electronics Limited include the following items (dollars in thousands): {Requirements} 1. Compute HiFlite's current ratio, debt ratio, and earnings per share. Use...
-
Comparative financial statement data of Panfield Optical Mart follow: Other information: 1. Market price of Panfield common stock: \(\$ 94.38\) at December 31, 2020; and \(\$ 85.67\) at December 31,...
-
Assume that you are purchasing an investment and have decided to invest in a company in the publishing business. You have narrowed the choice to Thrifty Nickel Corp. and The Village Cryer Limited and...
Study smarter with the SolutionInn App