In this question, you will implement an account system with four main classes and test their...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In this question, you will implement an account system with four main classes and test their features in a test class. For this purpose, carefully follow these steps: 1. Check the given UML diagram carefully and implement the corresponding classes 2. Even not written, add at least one meaningful constructor, one tostring() method (which prints relative account holder information) and one equals() method to each class. In the parent constructor, do not forget to increment the number of holders each time a new account holder is created. 3. All setters and getters can be implemented similar to what we have done in our lectures. 4. maxAccount () method checks the list of accounts that the holder has and returns the account with the maximum balance. 5. computeCurrentCredit method returns the available credit amount by using this algorithm: a. for Corporate: if (Today's Year - entering Year) >10) return max (maxAccount().getBalance(/3, creditLimit); return creditLimit; else b. for Individual: IndividualHolder if (maxAccount().getBalance() > creditLimit) return creditLimit*1,5; else 6. Now, create a test/driver class, namely TestAccountHolders, and create 4 Corporate and 4 Individual holders here. Keep your account holders in an ArrayList. Since you are free to implement your own style constructors, I will not show any sample output. 7. For each holder, be sure that it has at least 2 accounts. 8. By traversing over your arraylist (NOT ONE BY ONE), compute the current credit of each holder and print corresponding information by calling that class' to String() method. return creditLimit; <<abstract>> AccountHolder #name: String #accountHolderId: String #creditLimit:int #entering Year:int #listOfAccounts:Account[] +totalNrOfHolders +getName():String +setName(name:String) +getId():String +setId(accountHolderId:String) +getCreditLimit():int +setCreditLimit(limit:int) -SSN:String +getSSN():String +setSSN(SSN:String) +computeCurrentCredit():int +getEntering Year():int +setEntering Year(limit:int) +maxAccount():Account +computeCurrentCredit():int KH Account -id:String -openingYear:int -balance:int +getId():String +setId(id:String) +getYear():int +set Year(opening Year:int) +getBalance ():int +setBalance (balance:int) Corporate Holder -taxid:String -getTaxId():String +setTaxId(id:String) +computeCurrentCredit():int In this question, you will implement an account system with four main classes and test their features in a test class. For this purpose, carefully follow these steps: 1. Check the given UML diagram carefully and implement the corresponding classes 2. Even not written, add at least one meaningful constructor, one tostring() method (which prints relative account holder information) and one equals() method to each class. In the parent constructor, do not forget to increment the number of holders each time a new account holder is created. 3. All setters and getters can be implemented similar to what we have done in our lectures. 4. maxAccount () method checks the list of accounts that the holder has and returns the account with the maximum balance. 5. computeCurrentCredit method returns the available credit amount by using this algorithm: a. for Corporate: if (Today's Year - entering Year) >10) return max (maxAccount().getBalance(/3, creditLimit); return creditLimit; else b. for Individual: IndividualHolder if (maxAccount().getBalance() > creditLimit) return creditLimit*1,5; else 6. Now, create a test/driver class, namely TestAccountHolders, and create 4 Corporate and 4 Individual holders here. Keep your account holders in an ArrayList. Since you are free to implement your own style constructors, I will not show any sample output. 7. For each holder, be sure that it has at least 2 accounts. 8. By traversing over your arraylist (NOT ONE BY ONE), compute the current credit of each holder and print corresponding information by calling that class' to String() method. return creditLimit; <<abstract>> AccountHolder #name: String #accountHolderId: String #creditLimit:int #entering Year:int #listOfAccounts:Account[] +totalNrOfHolders +getName():String +setName(name:String) +getId():String +setId(accountHolderId:String) +getCreditLimit():int +setCreditLimit(limit:int) -SSN:String +getSSN():String +setSSN(SSN:String) +computeCurrentCredit():int +getEntering Year():int +setEntering Year(limit:int) +maxAccount():Account +computeCurrentCredit():int KH Account -id:String -openingYear:int -balance:int +getId():String +setId(id:String) +getYear():int +set Year(opening Year:int) +getBalance ():int +setBalance (balance:int) Corporate Holder -taxid:String -getTaxId():String +setTaxId(id:String) +computeCurrentCredit():int
Expert Answer:
Answer rating: 100% (QA)
solve the problem Implement the classes Start by implementing the AccountHolder class This class should have the following attributes name A string to ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
In this question you will be asked to reflect on a project you have been involved in or observed, in which a design evolved, or could have evolved, through applying a theory of user behaviour. You...
-
Mark Hurd has just assumed the top job at H-P. He has asked you as a staff VP to draw up a course of action to get the ailing PC division up to competitive parity with Dell. If you need to make some...
-
Newsweek conducted a poll in which respondents were asked if they "favor or oppose using federal tax dollars to fund medical research using stem cells obtained from human embryos." Of those polled,...
-
A company uses the periodic review inventory model to calculate its reorder quantity. The company currently places orders weekly. The item is produced and shipped from Asia with a lead time of eight...
-
Variations in the resistivity of blood can give valuable clues to changes in the blood's viscosity and other properties. The resistivity is measured by applying a small potential difference and...
-
Fern Schimkes husband, Norbert, was obligated on two promissory notes in favor of Union National Bank. Some time prior to his death, Union National Bank prepared a guaranty contract that was given to...
-
(a) What are the key features of a TCP protocol? (b) Briefly mention any three. (c) What are the key features of a UDP protocol? (d) Briefly mention any three. (e) Mention any two differences between...
-
A particle of mass, m, is constrained to oscillate in one dimension over the interval from 2b The particle is described by the wavefunction, 2b 0(x) = N cos(bx) , where b is a constant describing...
-
Provide two examples of how you establish and maintain open communication processes with relevant stakeholders (e.g. children, families, colleagues, management, community)
-
Normal America, Inc. (NA), has paid a year-end dividend every year for the past 10 years, as shown in the table below: Anne Share price as of December 31. Dividend of December 15. per share SP500...
-
Please help me with Four (4) Examples of a sales campaign in collaboration with the marketing department for a sports organization such as an NBA, NFL or MLB team.
-
Use the spinner to find each theoretical probability a). P (a number no more than 5) b). P (an even number) c). P (a number less than 3) 8 7 1 2 6 5 3
-
Can you identify examples of non-U.S. movies or products that have been modified for marketing in the United States?
-
A 1199 kg mass car travels with a constant speed of v = 50 km/hour towards a hill that has a semicircular cross section of radius, R = 70 m in a region near the top of the hill as shown in the...
-
Calculate the change in entropy when 100 kJ of energy is transferred reversibly and isothermally as heat to a large block of copper at (i) 0 C, (ii) 50 C.
-
This question requires that you obtain data from the Federal Reserve Economic Database (FRED) (http://research.stlouisfed.org/fred2/). On this page, you can locate GDP data and then import/export...
-
Consider a country that experiences a positive, one-time shock to its output. Assume that output is initially $1,200 per year and the world real interest rate is 6%. In year 0, output increases by...
-
Using the Ricardian model, explain why American workers receive higher wages in the production of automobiles than do Chinese workers.
-
Let \(F: \mathbb{R} ightarrow[0,1]\) be a distribution function. a) Show that there exists a probability space \((\Omega, \mathscr{A}, \mathbb{P})\) and a random variable \(X\) such that...
-
Let \(\left(B_{t}ight)_{t \geqslant 0}\) be a \(\mathrm{BM}^{d}\) and assume that \(X\) is a \(d\)-dimensional random variable which is independent of \(\mathscr{F}_{\infty}^{B}\). a) Show that...
-
Let \(\left(B_{t}, \mathscr{F}_{t}ight)_{t \geqslant 0}\) be a \(\mathrm{BM}^{1}\). Show that \(X_{t}=\exp \left(a B_{t}+b tight), t \geqslant 0\), is a martingale if, and only if, \(a^{2} / 2+b=0\).
Study smarter with the SolutionInn App