Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. Suppose that the Loan class is given as shown in the following UML. Write a test program that does the following tasks: create a

image text in transcribed
3. Suppose that the Loan class is given as shown in the following UML. Write a test program that does the following tasks: create a Loan object with loan amount S40000, annual interest rate 5.5%, and number of years 15; b. display the monthly payment and total payment c. display the date information when the loan object was created. The Date class UML is also given below annual InterestRatc: double loanAmount: double lnDane: Dane +Loan) Loan ansuallinterestRate: double, Constructs a loan with specified interest rate, years, and The annoal inserest rate of the loan (default 25) The number ef years for the loan (default: 1) The loan amount (default 100) The date this loan was creatod Constructs a default loan object numberOfyears int loanAmount double) loan amount getAnnual interestRate) double Returns the annual interest rate of this loan. get NumberOYearsO: int petl.oanAmounto double getLoanDate):Date Returms the mumber of the years of this loan Retums the amount of this loan Retums the date of the creation of this loan Sets a new annual interest rate to this loan annualinterest Rate: double): void numberOfYears: intk void loanAmount double): void Sets a new mumber of years to this loan Sets a new amount so this loan monthlyPaymenep: double total Payment) double Rctums the monthly payment of this loan Retums the total payment of this loan java util. Date Datc) Daste elapse Time: long) Constructs a Date object for the current time. Constructs a Date object for a given time in milliseconds elapsed since January 1, 1970, GMT a string representing the date and time. toString0 String getTimeO: Iong Retums Retams the mumber of milliseconds since January 1, 1970, GMT setTime(elapseTime long) voidSets a new elapse time in the object

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions

Question

5. If yes, then why?

Answered: 1 week ago

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago