3. Suppose that the Loan class is given as shown in the following UML. Write a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
3. Suppose that the Loan class is given as shown in the following UML. Write a test program that does the following tasks: a. create a Loan object with loan amount $40000, 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. Loan The annual interest rate of the loan (default 25) The mumber of years for the loan (defalt 1) annualinterestRate double tumberorYears: int -loun Amount: double -loan Dune: Date The loan amount (default: 1000 The date this loan was created Loan) LoancannuallnterestRate double, Constructs a loan with specified interest rate, yean, and numberorYears int, loanAmount double) Constructa a default koan object loan amount Retuns the annal interest rate of this loan. Returns he number of the years of this loan petAnnuallnterestRate): double geNumberorYeano int petl.oanAmount): double gett.oanDate) Date setAnnualleteestRatel amallnterestRate double): void Retums the anount of this loan Retums the date of the creation of this loan Sets a new annual interest rate to this loan Sets a new mumber of years to thin loan setNumberorYearst umberofYear: int vold setl.oan Amount loan Amount double): void +monthlyPayment(0: double totalPayment) double Sets a new amount to this loan Retums the monthly payment of this loan. Retuma the total payment of this loan java util Date Constructs a Date object for the current time. +Date) Daterelapse Time: long) Constructs a Date object for a given time in milliseconds elapsed since Jamaary 1, 1970, GMT. Retums a string representing the date and time. Retums the number of milliseconds since January 1, 1970, GMT +tuString String getTime): long +setTime(elapseTime: long: void Sets a new elapse time in the object. 3. Suppose that the Loan class is given as shown in the following UML. Write a test program that does the following tasks: a. create a Loan object with loan amount $40000, 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. Loan The annual interest rate of the loan (default 25) The mumber of years for the loan (defalt 1) annualinterestRate double tumberorYears: int -loun Amount: double -loan Dune: Date The loan amount (default: 1000 The date this loan was created Loan) LoancannuallnterestRate double, Constructs a loan with specified interest rate, yean, and numberorYears int, loanAmount double) Constructa a default koan object loan amount Retuns the annal interest rate of this loan. Returns he number of the years of this loan petAnnuallnterestRate): double geNumberorYeano int petl.oanAmount): double gett.oanDate) Date setAnnualleteestRatel amallnterestRate double): void Retums the anount of this loan Retums the date of the creation of this loan Sets a new annual interest rate to this loan Sets a new mumber of years to thin loan setNumberorYearst umberofYear: int vold setl.oan Amount loan Amount double): void +monthlyPayment(0: double totalPayment) double Sets a new amount to this loan Retums the monthly payment of this loan. Retuma the total payment of this loan java util Date Constructs a Date object for the current time. +Date) Daterelapse Time: long) Constructs a Date object for a given time in milliseconds elapsed since Jamaary 1, 1970, GMT. Retums a string representing the date and time. Retums the number of milliseconds since January 1, 1970, GMT +tuString String getTime): long +setTime(elapseTime: long: void Sets a new elapse time in the object.
Expert Answer:
Answer rating: 100% (QA)
Required solution is given below import javautilDate class Loan Private instance variables private d... View the full answer
Related Book For
Posted Date:
Students also viewed these accounting questions
-
Suppose that the loan in Problem 10 permits an additional prepayment of principal on any scheduled payment date. Prepare another amortization schedule that reflects a prepayment of $1000 with the...
-
Suppose that the loan in Problem 12 permits an additional prepayment of principal on any scheduled payment date. Prepare another amortization schedule that reflects a prepayment of $10,000 with the...
-
Suppose that the loan in Problem 2 permits an additional prepayment of principal on any scheduled payment date. Prepare another amortization schedule that reflects a prepayment of $1500 with the...
-
Horizontal analysis (trend analysis) percentages for Epstein Companys sales, cost of goods sold, and expenses are shown below. Did Epsteins net income increase, decrease, or remain unchanged over the...
-
Explain the interlinking model of quality and profitability (Exhibit 4.2). How does it connect to business and operations strategy? Can you provide any examples of goods and services that support and...
-
Find the complement of the following expressions: (a) \(A \bar{B}+\bar{A} B\) (b) \((\bar{V} W+X) Y+\bar{Z}\) (c) \(W X(\bar{Y} Z+Y \bar{Z})+\bar{W} \bar{X}(\bar{Y}+Z)(Y+\bar{Z})\) (d)...
-
Which parts of the accounting equation does a sale on account affect? a. Accounts receivable and Accounts payable b. Accounts receivable and Retained earnings c. Accounts payable and Retained...
-
Learning curve, incremental unit-time learning model. Learning curve, incremental unit-time learning model, Assume the same information for Global Defense as in Exercise 10-29, except that Global...
-
The following cost relate to COBEED Corp for the year: Distribution Cost P 185,000 Direct materials 215,000 Conversion cost 435,000 Factory overhead 190,000 Compute for: TOTAL PERIOD COST:
-
You are working at a Trident Steel, a steel solution provider that manufactures steel for several industries, including construction, mining, and automotive industries. One of your immediate tasks is...
-
Steve and Rebecca have 2 small children ages 3 and 4. They have moved to the suburbs and bought a house to provide enough space for their kids to run around and burn energy so that they have time to...
-
The supply curve for a certain commodity is \(n=2,500 p-500\), and the demand curve for the same product is \(n=31,500-1,500 p\), where \(n\) is the number of items and \(p\) is the number of...
-
Solve the linear programming problems in Problems 56-59. The Thompson Company manufactures two industrial products, standard ( \(\$ 45\) profit per item) and economy (\$30 profit per item). These...
-
If we add Pascals matrix (Problem 55) and the identity matrix, we find [P] + [I] . For the order shown in Problem 55, Find the inverse of this matrix. Data from Problem 55 If we take the first few...
-
Solve the linear programming problems in Problems 56-59. Suppose the net profit per bushel of corn in Example 3 increased to \(\$ 2.00\) and the net profit per bushel of wheat dropped to \(\$ 1.50\)....
-
If we take the first few rows of Pascal's triangle and arrange them into a lower triangular matrix, we form what is called a Pascal matrix: a. Find the inverse of this matrix. b. Make a general...
-
Acme Enterprises, which uses a perpetual inventory system, recorded a debit to Sales Returns & Allowances and a credit to Accounts Receivable. (No other accounts were affected.) What business event...
-
QUESTION 2 The CEO of Farisha Hijab Sdn Bhd insisted on further investigation to be carried out that he also required Mr Muaz to conduct the analysis of variance for the material and labour of the...
-
If the consumer has a positive marginal utility for each of two goods, why will the consumer always choose a basket on the budget line?
-
For the following pairs of goods, would you expect the cross-price elasticity of demand to be positive, negative, or zero? Briefly explain your answers. a) Tylenol and Advil b) DVD players and VCRs...
-
Every year there is a shortage of Super Bowl tickets at the official prices P0. Generally, a black market (known as scalping) develops in which tickets are sold for much more than the official price....
-
A common-size income statement for Liberty would report (amounts rounded) a. Net income of \(16 \%\) b. Cost of sales at \(36 \%\) c. Sales of \(100 \%\) d. All the above
-
During 2005 , Liberty's days' sales in receivables ratio was a. 39 day's b. 37 day's c. 35 day's d. 30 days
-
The company has 2,500 shares of common stock outstanding. What is Liberty's earnings per share? a. 2.04 b. 3.6 times c. \(\$ 1.22\) d. \(\$ 3.05\)
Study smarter with the SolutionInn App