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
What level of wildfire risk do people living in Boulder have?
Luba_88 [7]

Answer:

The risk of catastrophic wildfire is a real and serious threat facing those who reside in the forested areas of Boulder County. Dating back to the Black Tiger Fire of 1989, wildfires have collectively destroyed some 250 homes or other structures, burned over 16,000 acres, and threatened the lives and properties of thousands of mountain residents. In an attempt to mitigate the loss of life and property in Boulder County, the Land Use Department has included wildfire mitigation measures in the planning review and building permit process.

Explanation:

8 0
2 years ago
Free brainlist because im new and i just want to but you have t friend me first
Amiraneli [1.4K]
Okay sure.









I’ll 1)chords
2)pulse
3)aerophone
4) the answer is C
5)rhythm

Pretty sure those are the answers
4 0
2 years ago
A rigid tank whose volume is 2 m3, initially containing air at 1 bar, 295 K, is connected by a valve to a large vessel holding a
bazaltina [42]

Answer:

Q_{cv}=-339.347kJ

Explanation:

First we calculate the mass of the aire inside the rigid tank in the initial and end moments.

P_iV_i=m_iRT_i (i could be 1 for initial and 2 for the end)

State1

1bar*|\frac{100kPa}{1}|*2=m_1*0.287*295

m_1=232kg

State2

8bar*|\frac{100kPa}{1bar}|*2=m_2*0.287*350

m_2=11.946

So, the total mass of the aire entered is

m_v=m_2-m_1\\m_v=11.946-2.362\\m_v=9.584kg

At this point we need to obtain the properties through the tables, so

For Specific Internal energy,

u_1=210.49kJ/kg

For Specific enthalpy

h_1=295.17kJ/kg

For the second state the Specific internal Energy (6bar, 350K)

u_2=250.02kJ/kg

At the end we make a Energy balance, so

U_{cv}(t)-U_{cv}(t)=Q_{cv}-W{cv}+\sum_i m_ih_i - \sum_e m_eh_e

No work done there is here, so clearing the equation for Q

Q_{cv} = m_2u_2-m_1u_1-h_1(m_v)

Q_{cv} = (11.946*250.02)-(2.362*210.49)-(295.17*9.584)

Q_{cv}=-339.347kJ

The sign indicates that the tank transferred heat<em> to</em> the surroundings.

8 0
2 years ago
3. This material is considered flammable.
almond37 [142]

Answer:

All of the above

Explanation:

Most of materials are flammable because of the chemicals theyre made up of.  Most materials that are bought say to keep them at room temature for a reason.

4 0
2 years ago
Read 2 more answers
How much does It cost to make a tracking chip
Basile [38]

Answer:

about 4 grand

Explanation:

6 0
2 years ago
Other questions:
  • In a diesel engine, the fuel is ignited by (a) spark (c) heat resulting from compressing air that is supplied for combustion (d)
    14·1 answer
  • The Hoover Dam is 221 m tall and 379 m wide. Approximating it as a flat plate, determine the effective resultant force on the da
    6·1 answer
  • What is the difference between the pressure head at the end of a 150m long pipe of diameter 1m coming from the bottom of a reser
    7·1 answer
  • How to update android 4.4.2 to 5.1 if there isnt any update available​
    15·2 answers
  • Please I need help!<br><br> I need 1,2,&amp;3 drawn with front top and side view. Please help asap
    6·1 answer
  • The primary energy source for the controller in a typical control system is either brainlythe primary energy source for the cont
    10·1 answer
  • What is the purpose of the graphic language?
    15·1 answer
  • While discussing the diagnosis of an EI system in which the crankshaft and camshaft sensor tests are satisfactory but a spark te
    13·1 answer
  • The pressure at the bottom of an 18 ft deep storage tank for gasoline is how much greater than at the top? Express your answer i
    15·1 answer
  • Explain the LWD process why is it important in drilling operations?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!