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
-
We deposited $1500 in a bank account with an annual compound interest rate of 5%, compounded annually. Supposing we don't deposit or withdraw money, how long will we have to wait until we can first...
-
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....
-
(a) If A is an m x n matrix and M = (A | b) the augmented matrix for the linear system Ax = b. Show that either (i) Rank A = rank M, or (ii) Rank A = rank M - 1. (b) Prove that the system is...
-
We begin by considering the behavior of a pith ball placed near a charged rod. Pith balls are small conducting spheres used in the lab setting to model point-like charges, they are usually hung from...
-
Dominick Portet Wines Inc. began operations to import fine wines from Australia to the United States. Sales and purchase information is pZro vided below. Assume that Portet Wines uses the LIFO method...
-
(a) To help her make a decision, Taliesha has asked you to list two positive points and two negative points about each plan. Prepare such a list. (b) Why might Talieshas employer provide an incentive...
-
CASE: Navedo v. 250 Willis Ave. Supermarket , 290 A.D. 246 (2002) What types of legal authorities are used in Navedo? Are they considered primary sources? If so, what type of primary? Are they...
-
True Corporation, a wholly owned subsidiary of Trumaine Corporation, generated a $400,000 taxable loss in its first year of operations. True's activities and sales are restricted to State A, which...
-
If a licensee wishes to terminate affiliation with a firm and enter affiliation with another, how is this accomplished? A - The licensee can start working as soon as the new principal broker approves...
-
We need something advanced. You know something that will help us solve a truly tough problem requiring "advanced decision-making." Do you remember studying the Amazon case where they faced a monster...
-
If I have run a coffee shop and have two entities - orders and menuItems, which is the strong entity and which is the weak entity and why. 2.What is an entity class vs an entity instance 3.What Makes...
-
Sofia, a salesperson, is on her client's company website and is studying about the company's work environment, corporate culture, and their short and long-term goals. In this context, Sofia is trying...
-
Can you kindly assist me with the below. I really appreciate your assitance. each wortth forrttyyy poiiinttss. Thank again for helping. Large IT departments have traditionally been the focus of...
-
In the figure shown below, all angles are right angles, and the side lengths given are in centimeters. What is the area, in square centimeters, of the figure? 6 9 13 3 3
-
Given the Following: Amount Borrowed: 200,000 APR: 3% Term: 8 years a. What is the monthly payment? b. What is the amount of the monthly payment that is interest in the 8th? month? c. What is the...
-
The following selected accounts and normal balances existed at year-end. Notice that expenses exceed revenue in this period. Make the four journal entries required to close the books: Accounts...
-
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?
-
A sheep farmer will blend three types of feed for his sheep, costing \(\$ 1\) per pound, \(\$ 2\) per pound, and \(\$ 3\) per pound, respectively. Feed 1 consists of \(50 \%\) fat and \(50 \%\)...
-
Solve the standard minimum problem: minimize: g=y + y2 y + 12 2 4 y + y2 8 subject to: yi + 4y = 8 V1, V2 0
-
Suppose that in the final simplex system for a dual maximum problem of a given minimum problem, there is a non-basic variable in the objective row with coefficient zero. Recall that this indicates...
Study smarter with the SolutionInn App