Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Python Programming

OOP - Classes

Write a program to calculate and display the loan for buying a car.

1. Create a class call Loan.

Data fields in the Loan class include:

1. Annual Interest Rate (Float)

2. Number of years of loan (Float)

3. Loan Amount (Float)

4. Borrower's Name (string)

2. Create the initializer or constructor for the class with the above data fields. Make the data fields private.

3. Create accessors (getter) for all the data fields.

4. Create mutators (setters) for all the data fields.

5. Create a class method- getMonthlyPayment where monthlyPayment = loanAmount * monthlyInterestRate / (1 - (1 / (1 + monthlyInterestRate) ** (numberOfYears * 12)))

note: that the monthly interest rate = annualinterest / 1200

6. Create a class method - getTotalPayment where totalPayment = getMonthlyPayment() * \ numberOfYears * 12

7. Write a test program (main function) to allow the user to enter the following:

1. Annual Interest Rate

2. Number of Years of Loan

3. Loan Amount

4. Borrower's Name

Allow the user to change the loan amount and reprint the new loan information.

The output should look like this:

>>> 

Enter yearly interest rate, for example, 7.25: 2.5 Enter number of years as an integer: 5

Enter loan amount, for example, 120000.95: 1000.00 Enter a borrower's name: John Jones

The loan is for John Jones

The monthly payment is 17.75 The total payment is 1064.84

Do you want to change the loan amount? Y for yes or enter to quit y Enter new loan amount 5000

The loan is for John Jones

The monthly payment is 88.74 The total payment is 5324.21

>>> 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91779584
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

Question suppose that incoming packets are encrypted with a

Question : Suppose that incoming packets are encrypted with a symmetric key that only the sender and receiver know. Which type(s) of firewall will work with such packets and which will not? Why? Note: Some specific answe ...

A single card is randomly drawn from one standard 52-card

A single card is randomly drawn from one standard 52-card deck of playing cards, and events C and D are as follows: C=the card drawn is a king; D-the card drawn is a heart. Find the probability of event C or event D occu ...

Question write a 2 page briefing paper in which you present

Question: Write a 2 page briefing paper in which you present a summary of the issues (including a description of the types of intellectual property which may have been stolen). You should then summarize your research int ...

Please do it in c programrevisit the matrix addition

Please do it in C program Revisit the matrix addition function Write the program so that it would not need to take a third pointer for the result matrix Instead, have the function return a pointer to the results matrix P ...

A researcher knows that the average distance commuting

A researcher knows that the average distance commuting students live from campus was previously 8.2 miles. Because of the rising prices of gasoline, the research wants to test the claim that commuting students now live c ...

Question topic business informationsearching relevant

Question: Topic: Business Information Searching relevant scholarly journal articles, research and discuss the following prompts. Include a minimum of two (2) scholarly journal articles relevant to each prompt for a total ...

What is the role of arp and how does it cause a security

What is the role of ARP and how does it cause a security concern? What is the different between global and private IP addresses? How does using NAT change a private IP address into a global IP address, and why is this so ...

Annual demand and supply for the mylan company is given

Annual demand and supply for the Mylan company is given by: QD = 5,000 + 0.5 I + 0.2 A - 100P, and QS = -5000 + 100P where Q is the quantity per year, P is price, I is income per household, and A is advertising expenditu ...

Asses the challenges faced by financial managers due to

Asses the challenges faced by financial managers due to changes in the macroeconomic environment and how these impact businesses operations. Emphasize how there are consequences related to changes in strategies and prior ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As