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 common process for increasing the moisture content of air is to bubble it through a column of water. The air bubbles are assum
likoan [24]

Answer:

Explanation:

Assumptions is that

1. The flow is an unsteady one

2. Bubbles diameter is constant

3. The bubble velocity is slow

4. There is no homogenous reaction

5. It has a one dimensional flux model along the radial direction

5 0
3 years ago
11. Which of these is NOT true when dealing with refrigerants?
Alexus [3.1K]
Answer is an increase in pressure will cause an decrease in the pressure
4 0
3 years ago
Steam at 1 MPa, 300 C flows through a 30 cm diameter pipe with an average velocity of 10 m/s. The mass flow rate of this steam i
stealth61 [152]

Answer:

\dot m = 2.74 kg/s

Explanation:

given data:

pressure 1 MPa

diameter of pipe  =  30 cm

average velocity = 10 m/s

area of pipe= \frac[\pi}{4}d^2

                 = \frac{\pi}{4} 0.3^2

A = 0.070 m2

WE KNOW THAT mass flow rate is given as

\dot m = \rho A v

for pressure 1 MPa, the density of steam is = 4.068 kg/m3

therefore we have

\dot m = 4.068 * 0.070* 10

\dot m = 2.74 kg/s

7 0
3 years ago
Who can help me with electric systems for cars?
hoa [83]

Answer: i can see if i can what is the problem

Explanation:

7 0
3 years ago
A cone penetration test was carried out in normally consolidated sand, for which the results are summarized below: Depth (m) Con
Cerrena [4.2K]

Answer:

hello your question is incomplete attached below is the missing equation related to the question  

answer : 40.389° , 38.987° , 38° , 39.869° , 40.265°

Explanation:

<u>Determine the friction angle at each depth</u>

attached below is the detailed solution

To calculate the vertical stress = depth * unit weight of sand

also inverse of Tan = Tan^-1

also qc is in Mpa while σ0 is in kPa

Friction angle at each depth

2 meters = 40.389°

3.5 meters  = 38.987°

5 meters = 38.022°

6.5 meters = 39.869°

8 meters = 40.265°

6 0
3 years ago
Other questions:
  • Using Von Karman momentum integral equation, find the boundary layer thickness, the displacement thickness, the momentum thickne
    14·1 answer
  • How would an engineer know if a product design were feasible?
    8·2 answers
  • Plot the following trig functions using subplots, choosing an appropriate layout for the number of functions displayed. The subp
    8·1 answer
  • 1. Represent each of the following combinations of units in the correct SI form using the appropriate prefix: (a) μMN, (b) N/μm,
    6·1 answer
  • The Ethernet (CSMA/CD) alternates between contention intervals and successful transmissions. Assume a 100 Mbps Ethernet over 1 k
    5·1 answer
  • read a file called filled in with a few sentences or a paragraph. Then write a function called typoglycemia, which scrambles the
    13·1 answer
  • Who is father of Engineer?
    9·2 answers
  • What should you consider when choosing the type of hearing protection you use?
    15·1 answer
  • What is code in Arduino to turn led on and off
    10·1 answer
  • ABS system is necessary?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!