b. (100pts) Implement the class Savings Account according to the following UML: Savings Account -annual InterestRate:...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
b. (100pts) Implement the class Savings Account according to the following UML: Savings Account -annual InterestRate: double -balance: double +Savings Account(balance: double) +calculateMonthly Interest(): double The annual interest rate for each saving account. The account balance. Constructs an account object with a specified balance. Returns the monthly interest. The interest should be added to savingsBalance. +modifyInterest Rate (annual Interest Rate: double): void Sets a new annual InterestRate. +getBalance(): double +setBalance(balance: double): void Return the balance. Set a new balance. Use a private static data field to store the annualInterestRate for each of the savers. Each instance of the class contains a private instance data field savingsBalance, indicating the amount the saver currently has on deposit. Provide method calculateMonthly Interest to calculate the monthly interest by multiplying the savingBalance by annualInterestRate divided by 12; this interest should be added to savingsBalance. Provide a static method modify InterestRate that sets the annualInterestRate to a new value. Provide one constructor which takes a double type parameter to initialize the savingsBalance. C. (100 pts) Based on the previous Savings Account, write a test program called TestSavings Account that should do the following tasks: 1) Create a savings account object called myAccount with $10,000. 2) Set the annual interest rate as 6%, which is 0.06. 3) Calculate and display monthly interest of the account. 4) Display the new balance of the account. A sample output: The original balance is $10000.0 The monthly interest is $50.0 The new balance is $10050.0 b. (100pts) Implement the class Savings Account according to the following UML: Savings Account -annual InterestRate: double -balance: double +Savings Account(balance: double) +calculateMonthly Interest(): double The annual interest rate for each saving account. The account balance. Constructs an account object with a specified balance. Returns the monthly interest. The interest should be added to savingsBalance. +modifyInterest Rate (annual Interest Rate: double): void Sets a new annual InterestRate. +getBalance(): double +setBalance(balance: double): void Return the balance. Set a new balance. Use a private static data field to store the annualInterestRate for each of the savers. Each instance of the class contains a private instance data field savingsBalance, indicating the amount the saver currently has on deposit. Provide method calculateMonthly Interest to calculate the monthly interest by multiplying the savingBalance by annualInterestRate divided by 12; this interest should be added to savingsBalance. Provide a static method modify InterestRate that sets the annualInterestRate to a new value. Provide one constructor which takes a double type parameter to initialize the savingsBalance. C. (100 pts) Based on the previous Savings Account, write a test program called TestSavings Account that should do the following tasks: 1) Create a savings account object called myAccount with $10,000. 2) Set the annual interest rate as 6%, which is 0.06. 3) Calculate and display monthly interest of the account. 4) Display the new balance of the account. A sample output: The original balance is $10000.0 The monthly interest is $50.0 The new balance is $10050.0
Expert Answer:
Posted Date:
Students also viewed these programming questions
-
Suppose you are a hedge fund. You are trying to form a portfolio out of a number of risky assets and a risk-free asset. Throughout the question, assume you can take arbitrarily large short or...
-
Hard(s) could OSHA use to issue citations? ctive or control measures could be used?
-
Determine the forces in members BE and CE of the loaded truss. The forces are positive if in tension, negative if in compression. 3.4 m 5.0 kN 5.6 KN 43 A 2.9 m E 2.9 m BC=CD Answers: BE- i KN CE- i...
-
Which of the following is not a suggested procedure to establish internal control over cash disbursements? The bank statement is reconciled monthly. Anyone can sign the checks. Blank checks are...
-
The index of refraction of crown glass is 1.515 for red light and 1.523 for blue light. (a) If light of both colors is incident on crown glass from air, the blue color will be refracted (1) more, (2)...
-
Regional Airlines (RA) is a wholly owned subsidiary of National Commercial Airlines (NCA). Both companies prepare financial statements in accordance with International Financial Reporting Standards...
-
Describe five ways of placing a monetary value on the investment base in arriving at a measure of invested capital.
-
Loreal-American Corporation purchased several marketable securities during 2011. At December 31, 2011, the company had the investments in common stock listed below. None was held at the last...
-
2) A joint pdf is described below. A new random variable is formed as shown: W = Y+X. Determine an expression for the CDF for W. Please solve all integrals y 4 -4 -4 1 fxy(x, y) = 128 0 4 x -4 < y <...
-
Q.1 A company has purchased a large items of plants. The following costs were incurred. List price of the machine 1,000,000 Trade discount given Delivery cost Installation cost Expected Useful life...
-
Define the term day count basis.
-
What types of problems does data redundancy cause?
-
What is a partitioned database, and what are its advantages? Specify any disadvantages.
-
What complications arise when one values a bond on a settlement date between coupon payment dates?
-
Firm F manufactures and sells two products: A and B. (Exercise courtesy of Prof. Mara Jess Grandes from IESE Business School.) Parameters for both products are as follows: Note that fixed costs are...
-
7. You decide to buy P1,800,00 home. If you make a 25% down payment, you can get a 20-year mortgage at 9%, but if you can make a 10% down payment, you can get a 25-year mortgage at 7%. Which is the...
-
Determine the resultant moment produced by the forces about point O. 0.25 m 0.125 m, 0 0.3 m- 60 F = 500 N F = 600 N
-
Outerwear Inc. is concerned about the profitability of its regular gloves. Company managers are considering producing only the top-quality, fleece lined, gloves. The company is currently assigning...
-
High Country Outfitters, Inc., makes backpacks for large sporting goods chains that are sold under the customers store brand names. The accounting department has identified the following overhead...
-
Refer to the previous exercise in P5-1B for Hickory Grill. Required a. Comment on the differences between the solutions to requirements (a) and (b). Which is more accurate? What errors might managers...
Study smarter with the SolutionInn App