What would the code look like to something like this? I have some code written but I
Question:
What would the code look like to something like this? I have some code written but I feel like it makes no sense for what this is asking me to do.
- The First National Bank of San Diego has tasked you to write a mortgage analyzer library for its loan officers to use. For this lab, you are only required to create a set of Java classes that represent the applications business logic.
- Using the following simple use cases implement a Java class e.g. MortgageAnalyzer and any potential Java interfaces for the following actions :
- The user can enter the amount of the loan, the annual rate of interest, and the duration of the loan in months - this will require public member functions that can be used to enter this information into the MortgageAnalyzer class.
- The user can run a verification check on the information that was entered to make sure it is reasonable - this can be a verify member function that returns a Boolean true on success.
- If bad or anomalous data was entered in setting up details of the loan the user should be advised and allowed to correct the input data - a public correctInput member function as an example.
- Once the data is verified to be correct or reasonable the user should invoke a public member function on the class named calculateMortgageDetails to get the following example information using one or a series of API calls internal to the class:
- Amount of Loan - $140000
- Annual Interest Rate - 8.00%
- Duration of loan in months - 360
- Monthly payment - $1027.27
- Total interest paid - $229,817.20
The formula for the monthly payment is:
payment = p * r * (1 + r)n / ((1 + r)n - 1)
where p is the principal amount of the loan, r is the monthly interest rate (annual rate divided by 12) given as a number between 0 (for 0 percent) and 1 (for 100 percent), and n is the duration of the loan (number of pay periods e.g., 360). The formula for the total interest paid is:
Total interest = n * payment - p
In addition create a unit test for your library, and as an example, the following data can be used to test your program:
Input:
Amount of Loan - $140000
Annual Interest Rate - 8.00%
Duration of loan in months - 360
Output:
Monthly payment - $1027.27
Total interest paid - $229,817.20
Fundamentals of Case Management Practice Skills for the Human Services
ISBN: 978-1305094765
5th edition
Authors: Nancy Summers