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
Steam flows steadily through an adiabatic turbine. The inlet conditions of the steam are 10 MPa, 450°C, and 80 m/s, and the exit
8090 [49]

Answer:

a) The change in Kinetic energy, KE = -1.95 kJ

b) Power output, W = 10221.72 kW

c) Turbine inlet area, A_1 = 0.0044 m^2

Explanation:

a) Change in Kinetic Energy

For an adiabatic steady state flow of steam:

KE = \frac{V_2^2 - V_1^2}{2} \\.........(1)

Where Inlet velocity,  V₁ = 80 m/s

Outlet velocity, V₂ = 50 m/s

Substitute these values into equation (1)

KE = \frac{50^2 - 80^2}{2} \\

KE = -1950 m²/s²

To convert this to kJ/kg, divide by 1000

KE = -1950/1000

KE = -1.95 kJ/kg

b) The power output, w

The equation below is used to represent a  steady state flow.

q - w = h_2 - h_1 + KE + g(z_2 - z_1)

For an adiabatic process, the rate of heat transfer, q = 0

z₂ = z₁

The equation thus reduces to :

w = h₁ - h₂ - KE...........(2)

Where Power output, W = \dot{m}w..........(3)

Mass flow rate, \dot{m} = 12 kg/s

To get the specific enthalpy at the inlet, h₁

At P₁ = 10 MPa, T₁ = 450°C,

h₁ = 3242.4 kJ/kg,

Specific volume, v₁ = 0.029782 m³/kg

At P₂ = 10 kPa, h_f = 191.81 kJ/kg, h_{fg} = 2392.1 kJ/kg, x₂ = 0.92

specific enthalpy at the outlet, h₂ = h_1 + x_2 h_{fg}

h₂ = 3242.4 + 0.92(2392.1)

h₂ = 2392.54 kJ/kg

Substitute these values into equation (2)

w = 3242.4 - 2392.54 - (-1.95)

w = 851.81 kJ/kg

To get the power output, put the value of w into equation (3)

W = 12 * 851.81

W = 10221.72 kW

c) The turbine inlet area

A_1V_1 = \dot{m}v_1\\\\A_1 * 80 = 12 * 0.029782\\\\80A_1 = 0.357\\\\A_1 = 0.357/80\\\\A_1 = 0.0044 m^2

3 0
3 years ago
Tech A says you can find the typical angle of a V-block engine by dividing the number of cylinders by 720
Lady_Fox [76]

Answer:

Tech A is correct

Explanation:

Tech A is right as its V- angle is identified by splitting the No by 720 °. Of the piston at the edge of the piston.

Tech B is incorrect, as the V-Angle will be 720/10 = 72 for the V-10 motor, and he says 60 °.

8 0
2 years ago
Georgia Tech is committed to creating solutions to some of the world’s most pressing challenges. Tell us how you have improved o
Kaylis [27]

Answer:

Georgia Tech is committed to WGAR 53566 THE ANSWER IS JELLY IS KING AND THE JELLY IS KING AND  hope to improve the human condition in your community.

Explanation:

6 0
3 years ago
g Nuclear power supplies about _______ of all electricity in Europe. Nuclear power supplies about _______ of all electricity in
Alex_Xolod [135]

Answer:

The answer is not in the options. It is one-fourth.

Explanation:

As of 2017, it was recorded that nuclear power supplies 25% of electricity in Europe. That's 1/4 of the total electrical power supply.

5 0
3 years ago
An amplifier which needs a high input resistance and a high output resistance is : Select one: a. A voltage amplifier b. None of
True [87]

Answer:

None of these

Explanation:

There are different types of amplifiers, and each has different characteristics.

  • Voltage amplifier needs high input and low output  resistance.
  • Current amplifier needs Low Input and High Output  resistance.
  • Trans-conductance amplifier Low Input and High Output resistance.
  • Trans-Resistance amplifier requires High Input and Low output  resistance.

Therefore, the correct answer is "None of these "

3 0
3 years ago
Other questions:
  • Which statement about direct-mail messages is most accurate? Group of answer choices Direct mail is an effective channel for per
    15·1 answer
  • - The four leading causes of death in the
    5·2 answers
  • The yield of a chemical process is being studied.The two most important variables are thought to be the pressure and the tempera
    9·1 answer
  • Is air conditioner a refrigerator?
    10·1 answer
  • Which type of load is not resisted by a pinned joint? A) Moment B) Shear C) Axial D) Compression
    7·1 answer
  • In the SI system of units, the absolute temperature is measured to be 303 K Its value in Fahrenheit is a-) 76 F b)- 86F c)-79 F
    9·1 answer
  • An object at a vertical elevation of 20 m and a speed of 5 m/s decreases in elevation to an elevation of 1 m. At this location,
    15·1 answer
  • An automobile engine consumes fuel at a rate of 22 L/h and delivers 85 kW of power to the wheels. If the fuel has a heating valu
    8·2 answers
  • (,,)=^3−^3+^3, where is the sphere ^2 + ^2 + ^2=^
    6·1 answer
  • 3.8 LAB - Select lesson schedule with multiple joins
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!