1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
elena55 [62]
3 years ago
14

Create a program that calculates the monthly payments on a loan using Decimal & LC Console SEE Sanple Run Attached Specifica

tions  The interest rate should only use 1 decimal place for both the calculation and the formatted results.  The formula for calculating the monthly payment is: monthly_payment = loan_amount * monthly_interest_rate / (1 - 1 / pow( (1 + monthly_interest_rate), months))  Assume that the user will enter valid data.

Engineering
1 answer:
diamong [38]3 years ago
5 0

Answer:

Consider the following code.

Explanation:

Code:

Unix Terminal> cat loan_calc.py

#!/usr/local/bin/python3

import locale

from decimal import *

def main():

locale.setlocale(locale.LC_ALL, 'en_US')

print('Monthly Payment Calculator')

while True:

print('DATA ENTRY')

loan_amt = input('Loan amount: ')

loan_amt = float(loan_amt)

int_rate = input('Yearly interest rate: ')

int_rate = float(int_rate)

years = input('Years: ')

years = int(years)

mon_rate = int_rate / 12 / 100

months = years * 12

monthly_pay = loan_amt * mon_rate / ( 1 - 1/(1 + mon_rate) ** months)

monthly_pay = Decimal(monthly_pay).quantize(Decimal('.01'), rounding=ROUND_DOWN)

print()

print('FORMATTED RESULT')

print('Loan amount: %30s' %locale.currency(loan_amt))

print('Yearly interest rate: %20.2f' %int_rate + '%')

print('Number of years: %25d' %years)

print('Montly payment: %25s' %locale.currency(monthly_pay))

print()

print('Continue? (y/n): ')

choice = input().strip()

if choice.lower() == 'n':

break

if __name__=='__main__':

main()

Unix Terminal>

Code output screenshot:

You might be interested in
a circular pile, 19 m long is driven into a homogeneous sand layer. The piles width is 0.5 m. The standard penetration resistanc
Elena L [17]

Answer:

Point force (Qp) = 704 kn/m²

Explanation:

Given:

length = 19 m

Width = 0.5 m

fs = 4

Vicinity of the pile = 25

Find:

Point force (Qp)

Computation:

Point force (Qp) = fs²(l+v)

Point force (Qp) = 4²(25+19)

Point force (Qp) = 16(44)

Point force (Qp) = 704 kn/m²

5 0
3 years ago
Breh/bro <br><br>what is this, finally I can learn programming​
LenKa [72]

Answer:

It's an intoduction to hacking and systematic programming.

Explanation:

Yes, you might be able to grasp a few things from it, but it also may be a way hackers could hack you, by luring you to click it.

8 0
3 years ago
What is the tool used to take off a wheel nut
pishuonlain [190]

Answer:

A socket wrench

Explanation:

My dad is a mechanic

8 0
3 years ago
Read 2 more answers
After a program has downloaded to a PLC, what must be selected?
Hitman42 [59]

Answer:

A driver is an independent software application that is used to configure communication between a personal or industrial computer and a hardware device

5 0
2 years ago
List, in ascending order, the cutoff frequencies for the first ten modes of a rectangular waveguide, normalized to the cutoff fr
Alisiya [41]

Answer:

Fcte10 < Fcte01 = Fcte0 < Fctm11 < Fcte21 = Fctm21 < Fcte12 = Fctm12 < Fcte22

Explanation:

Assuming a = 2b

Attached below is the required steps to the solution

The cutoff frequencies for the first ten modes of a rectangular waveguide listed in ascending order  is :

Fcte10 < Fcte01 = Fcte0 < Fctm11 < Fcte21 = Fctm21 < Fcte12 = Fctm12 < Fcte22

5 0
3 years ago
Other questions:
  • Name 3 ways in which robots have improved since the Ebola outbreak.
    11·1 answer
  • A circular hoop sits in a stream of water, oriented perpendicular to the current. If the area of the hoop is doubled, the flux (
    8·1 answer
  • What is the capacity of the machine in batches?
    10·1 answer
  • What is your employer required to have on fixed ladders that extend more than 24 feet in the workplace?
    15·2 answers
  • .a. What size vessel holds 2 kg water at 80°C such that 70% is vapor? What are the pressure and internal energy? b. A 1.6 m3 ves
    5·1 answer
  • 500 flights land each day at San Jose’s airport. Assume that each flight has a 5% chance of being late, independently of whether
    5·1 answer
  • In a creep test, increasing the temperature will (choose the best answer) A. increase the instantaneous initial deformation B. i
    5·1 answer
  • Explain the proper uses of shop equipment. (explain to me how to use 3 pieces of shop equipment.)
    7·1 answer
  • Cup-sveg-aph<br><br>I m finding gf<br><br>if anyone interested pls come​
    11·2 answers
  • Describe the risks associated with their working environment (such as the tools, materials and equipment that they use, spillage
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!