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
For laminar flow over a hot flat plate, the local heat transfer coefficient decreases with distance because (select all that are
kotegsom [21]

Answer:

B. The thickness of the heated region near the plate is increasing.

Explanation:

First we know that, a boundary layer is the layer of fluid in the immediate vicinity of a bounding surface where the effects of viscosity are significant. The fluid is often slower due to the effects of viscosity. Advection i.e the transfer of heat by the flow of liquid becomes less since the flow is slower, thereby the local heat transfer coefficient decreases.

From law of conduction, we observe that heat transfer rate will decrease based on a smaller rate of temperature, the thickness therefore increases while the local heat transfer coefficient decreases with distance.

3 0
4 years ago
(a) The lower yield point for an iron that has an average grain diameter of 1 x 10-2 mm is 230 MPa. At a grain diameter of 6 x 1
olya-2409 [2.1K]

Answer:

The answer is "4.35 \times 10^{-3}\  mm and 157.5 MPa".

Explanation:

In point A:

The strength of its products with both the grain dimension is linked to this problem. This formula also for grain diameter of 310 MPA is represented as its low yield point  

y =  yo + \frac{k}{\sqrt{x}}

Here y is MPa is low yield point, x is mm grain size, and k becomes proportionality constant.  

Replacing the equation for each condition:  

y = y_o + \frac{k}{\sqrt{(1 \times 10^{-2})}}\\\\\ \ \ \ \ \ \ 230 = yo + 10k\\\\ y = yo + \frac{k}{\sqrt{(6\times 10^{-3})}}\\\\275 = yo + 12.90k

People can get yo = 275 MPa with both equations and k= 15.5 Mpa mm^{\frac{1}{2}}.

To substitute the answer,  

310 = 275 + \frac{(15.5)}{\sqrt{x}}\\\\x = 0.00435 \ mm = 4.35 \times 10^{-3}\  mm

In point b:

The equation is \sigma y = \sigma 0 + k y d^{\frac{1}{2}}

equation is:

75 = \sigma o+4 ky \\\\175 = \sigma o+12 ky\\\\ky = 12.5 MPa (mm)^{\frac{1}{2}} \\\\ \sigma 0 = 25 MPa\\\\d= 8.9 \times 10^{-3}\\\\d^{- \frac{1}{2}} =10.6 mm^{-\frac{1}{2}}\\

by putting the above value in the formula we get the \sigma y value that is= 157.5 MPa

5 0
3 years ago
Block A hangs by a cord from spring balance D and is submerged in a liquid C contained in beaker B. The mass of the beaker is 1.
nikitadnepr [17]

Answer:

a)  m_e= 3.05 Kg

b)  \rho=1072.3kg/m^3

c)  m_e= 3.05 Kg

Explanation:

From the question we are told that:

Beaker Mass m_b=1.20

Liquid Mass m_l=1.85

Balance D:

Mass m_d=3.10

Balance E:

Mass m_e=7.50

Volume v=4.15*10^{-3}m^3

a)

Generally the equation for Liquid's density is mathematically given by

m_e=m_b+m_l+(\rho*v)

\rho=\frac{7.50-(1.2+1.85)}{4.15*10^{-3}}

\rho=1072.3kg/m^3

b)

Generally the equation for D's Reading at A pulled is mathematically given by

m_d = mass of block - mass of liquid displaced

m_d=m- (\rho *v )

m=3.10+ (1072.30 *4.15*10^{-3}m^3 )

m=18.10kg

c)

Generally the equation for E's Reading at A pulled is mathematically given by

m_e=m_b+m_l

m_e = 1.20 + 1.85

m_e= 3.05 Kg

6 0
3 years ago
Transmission cleaners are used: A) Only in conjunction with fuel system cleanersB) Only in the colder monthsC) By themselvesD) I
valentina_108 [34]

Answer: D

Explanation: When you change your transmission fluid you change your filter. When you do that you clean where the filter was. Then you can put the new filter on and the new fluid.

5 0
3 years ago
Read 2 more answers
When your complex reaction time is compromised by alcohol, an impaired person's ability to respond to emergency or unanticipated
babunello [35]

Answer:

decreased

Explanation:

when impaired you react slower then you would sober.

3 0
3 years ago
Other questions:
  • Scanning the road can be thought of as
    5·2 answers
  • Two well-known NP-complete problems are 3-SAT and TSP, the traveling salesman problem. The 2-SAT problem is a SAT variant in whi
    7·1 answer
  • The viscosity of all liquids decreases as the temperature is a) Increased b) decreased c) maintained constant d) fluctuating e)
    12·1 answer
  • Can a real refrigerator have higher COP than the COP of the Carnot refrigerator?
    7·2 answers
  • According to the EWR specifications, ___ is responsible for picking up and disposing of debris or rubbish from
    15·1 answer
  • The point in an electrical circuit that is connected to the negative side of a power supply is called what?
    8·1 answer
  • Who is the inventor that created the light bulb
    15·1 answer
  • 8.28 Water is the working fluid in an ideal Rankine cycle with superheat and reheat. Steam enters the first-stage turbine at 140
    13·1 answer
  • Wells drilled by a nonprofit called Water for South Sudan use a pump that can provide up to 5,500 gallons of water per day. Use
    10·1 answer
  • Contrast moral and immoral creativity and innovation<br>​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!