Question regarding the python programming

Assignment Help Basic Computer Science
Reference no: EM131055175

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

>>> 

Reference no: EM131055175

Questions Cloud

The total value of the two securities : Maritza has one share of stock and one bond. The total value of the two securities is 1,032 dollars. The bond has a YTM of 12.54 percent, a coupon rate of 11.28 percent, and a face value of 1,000 dollars; pays semi-annual coupons with the next one ex..
Sketch a block flow diagram of the process : Cinnamic aldehyde ( a fragrance compound) can be made by base catalysed aldol condensation reaction between benzaldehyde and acetaldehyde.the feeds are contacted with sodium hydroxide in a stirred tank reactor.
Dividends related to the information asymmetry problem : 1. How is Linear's decision to pay out dividends related to the information asymmetry problem 2. Should Linear return cash to shareholders? If so, how?
Question regarding the python programming : 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)
Stocks pay annual dividends that are expected to continue : Kwame owns one share of stock of Fairfax Paint and one share of stock of Litchfield Design. The total value of his holdings is 179 dollars. Both stocks pay annual dividends that are expected to continue forever. The expected return on Fairfax Paint s..
Stock portfolio with a total value : Mrs. Landis has a 2-stock portfolio with a total value of $520,000. $175,000 is invested in Stock A with a beta of 1.25 and the remainder is invested in Stock B with a beta of 1.25. What is her portfolio's beta?
Calculates the sum of all the gaps between successive array : calculates the sum of all the gaps between successive array elements. The array elements are double words, sequenced in nondecreasing order.
Present value of dividend expected to be paid in four years : Common stock of Fairfax Paint is currently priced at 90.39 dollars per share. The stock is expected to pay annual dividends that are expected to grow by 4.26 percent forever. The next dividend is expected in 1 year and the expected annual return for ..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Determine value of maximum element for mle is maximum

Assume that n = 5 points are drawn from distribution and maximum value of which occurs to be 0.6. Plot likelihood p(D|) in range 0  1. Describe in words why you do not need to know values.

  Develop your understanding of the kinds of bizarre problems

Develop your understanding of the kinds of bizarre problems a system administrator will have to handle. The first part depicts an organization in a bad state. Your job is to devise a scheme to fix it.

  Recognize the programming constructs of functions

Use the skater you created for the Unit 4 assignment. Add 2 cones to the ice that the skater will skate around in a figure 8. See Exercise 6-2 Exercise 7 and 8 as an example. You will first check the skater's position and use that information in maki..

  Explain the conceptual model employed in the design

Explain the conceptual model employed in the design of these types. Describe the analogies and concepts these monitors expose to users, including the task-domain objects users manipulate on the screen.

  Advantages and disadvantages of dbms-provided security

Describe the advantages and disadvantages of DBMS-provided security

  Describe elements of credit card theft and identity thef

Describe the elements of Credit Card Theft and Identity Theft. Describe how technology is used to facilitate these crimes

  Computing machinery and intelligence

Read the paper by Alan Turing, "Computing Machinery and Intelligence". In this paper, he describes a test that could be used to determine if a machine is intelligent. He referred to the test as the "Imitation Game".

  Success factors for an e-commerce business

What are the key success factors for an e-commerce business?

  Discuss the issues of the proponents and opponents

In an effort to counter the release of carbon dioxide by power plants in the United States, one thing that is being considered is that power plant owner's be allowed to invest in forests and trees that convert carbon dioxide to oxygen. Discuss the..

  Define a class called counter

The only method that can set the counter is the one that sets it to zero. Write a program to test your class definition. (Hint: you need only one instance variable).

  Memory segment in terms of its start address

The above segment descriptor describes a memory segment in terms of its start address, its size and whether it is ALLOCATED or FREE. This descriptor is part of a list (contains a pointer to next segment descriptor). Initially, there is only one se..

  How many orders invoices were shipped

How many orders (invoices) were shipped by Speedy Express?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd