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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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