Loan -annualInterestRate: double -numberOfYears: int -loanAmount: double +Loan() Constructs a default Loan object. +Loan(annualInterestRate: double, Constructs a loan with specified interest rate, years, and loan amount. numberOfYears: int, loanAmount: double) The annual interest rate of the loan (default: 2.5). The number of years for the loan (default: 1) The loan amount (default: 1000). +getAnnualInterestRate(): double +getNumberOfYears(): int +getL oanAmount(): double +setAnnualInterestRate( annualInterestRate: double): void +setNumberOfYears( number OfYears: int): void +setLoanAmount( loanAmount: double): void +getMonthly Payment(): double +getTotalPayment(): double Returns the annual interest rate of this loan. Returns the number of the years of this loan. Returns the amount of this loan. Sets a new annual interest rate to this loan. Sets a new number of years to this loan. Sets a new amount to this loan. Returns the monthly payment of this loan. Returns the total payment of this loan.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

please solve this using cpp.

Loan
-annualInterestRate: double
-numberOfYears: int
-loanAmount: double
+Loan()
+Loan(annualInterestRate: double,
numberOfYears: int,
loan Amount: double)
+getAnnualInterestRate(): double
+getNumberOfYears(): int
+getLoanAmount(): double
+setAnnualInterestRate(
annualInterestRate: double): void
+setNumberOfYears(
number OfYears: int): void
+setLoanAmount(
loanAmount: double): void
+getMonthlyPayment(): double
+getTotalPayment(): double
The annual interest rate of the loan (default: 2.5).
The number of years for the loan (default: 1)
The loan amount (default: 1000).
Constructs a default Loan object.
Constructs a loan with specified interest rate, years, and
loan amount.
Returns the annual interest rate of this loan.
Returns the number of the years of this loan.
Returns the amount of this loan.
Sets a new annual interest rate to this loan.
Sets a new number of years to this loan.
Sets a new amount to this loan.
Returns the monthly payment of this loan.
Returns the total payment of this loan.
Transcribed Image Text:Loan -annualInterestRate: double -numberOfYears: int -loanAmount: double +Loan() +Loan(annualInterestRate: double, numberOfYears: int, loan Amount: double) +getAnnualInterestRate(): double +getNumberOfYears(): int +getLoanAmount(): double +setAnnualInterestRate( annualInterestRate: double): void +setNumberOfYears( number OfYears: int): void +setLoanAmount( loanAmount: double): void +getMonthlyPayment(): double +getTotalPayment(): double The annual interest rate of the loan (default: 2.5). The number of years for the loan (default: 1) The loan amount (default: 1000). Constructs a default Loan object. Constructs a loan with specified interest rate, years, and loan amount. Returns the annual interest rate of this loan. Returns the number of the years of this loan. Returns the amount of this loan. Sets a new annual interest rate to this loan. Sets a new number of years to this loan. Sets a new amount to this loan. Returns the monthly payment of this loan. Returns the total payment of this loan.
Your class should include a test driver function main(). This main() should do the following:
1. Read annual interest rate, number of years and the loan amount.
2. Create a Loan object
3. Display the monthly payment and the total payment.
Make sure your program is working correctly.
2.1 Loan.h
9
Transcribed Image Text:Your class should include a test driver function main(). This main() should do the following: 1. Read annual interest rate, number of years and the loan amount. 2. Create a Loan object 3. Display the monthly payment and the total payment. Make sure your program is working correctly. 2.1 Loan.h 9
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 6 steps with 4 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education