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 car is about to start but it blows up. what is the problem with the car<br> ?
ratelena [41]

Answer:

because there is a bomb

6 0
3 years ago
Read 2 more answers
During the recovery of a cold-worked material, which of the following statement(s) is (are) true?
Len [333]

Answer:

Some of the internal strain energy is relieved.

There is some reduction in the number of dislocations.

The electrical conductivity is recovered to its precold-worked state.

The thermal conductivity is recovered to its precold-worked state

Explanation:

The process of the recovery of a cold-worked material happens at a very low temperature, this process involves the movement and annihilation of points where there are defects, also there is the annihilation and change in position of dislocation points which leads to forming of the subgrains and the subgrains boundaries such as tilt, twist low angle boundaries.

4 0
3 years ago
1. Under what conditions can soils be chemically stabilized?
marshall27 [118]

Answer:

All will be Explained below.

Explanation:

1) Under which Condition can a soil be chemically Stabilize.

Answer

a). Plasticity Index :A soil with a high value of plasticity Index is not good for various engineering projects. The introduction of line helps in reducing plasticity due cation exchange reaction.Pozzolanic reaction over time reduces plasticity and increase index strength due to the formation of calcium - silicate hydrate.

7 0
3 years ago
Select the correct answer.
MAVERICK [17]

Answer:crane and engine I guess

Explanation:

8 0
3 years ago
Which of the following has special properties that allow forces and pressure to be distributed evenly?
Thepotemich [5.8K]

Answer:

Fluids

Explanation:

Fluids has special properties that allow forces and pressure to be distributed evenly within them.

  • Fluids are gases and liquids whose intermolecular forces of attraction are generally weak or non-existence.
  • Therefore, when pressure is applied to them, it permeates evenly on all parts.
  • Their ability to tend to randomness makes liquids and gases very viable for distributing pressure.
7 0
3 years ago
Other questions:
  • Your program should read from an input file, which will contain one or more test cases. Each test case consists of one line cont
    14·1 answer
  • An overhead 25m long, uninsulated industrial steam pipe of 100mm diameter is routed through a building whose walls and air are a
    9·1 answer
  • A man weighs 145 lb on earth.Part ASpecify his mass in slugs.Express your answer to three significant figures and include the ap
    11·1 answer
  • In order to test the feasibility of drying a certain foodstuff, drying data were obtained in a tray dryer with air flow over the
    14·1 answer
  • A worker standing on a freshly mopped floor is
    7·1 answer
  • A(n) _________ is a current greater than the equipment rated current or conductor ampacity, which is confined to the normal cond
    12·1 answer
  • A town is designing a rectangular, 4m deep settling tank for treating surface water intake. The tank will have a flow velocity o
    14·1 answer
  • calculate the magnitude of the force acting on the pin at D. Pin C is fixed in DE and bears against the smooth slot in the trian
    9·1 answer
  • g Clay sized particles in a river are likely to be transported as _______________________, whereas gravel sized particles are li
    5·1 answer
  • 14. The flow water in a 10-in Schedule 40 pipe is to be metered. The temperature of the water is
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!