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
You find an unnamed fluid in the lab we will call Fluid A. Fluid A has a specific gravity of 1.65 and a dynamic viscosity of 210
Naily [24]

Answer:

1.2727 stokes

Explanation:

specific gravity of fluid A = 1.65

Dynamic viscosity = 210 centipoise

<u>Calculate the kinematic viscosity of Fluid A </u>

First step : determine the density of fluid A

Pa = Pw * Specific gravity =  1000 * 1.65 = 1650 kg/m^3

next : convert dynamic viscosity to kg/m-s

210 centipoise = 0.21 kg/m-s

Kinetic viscosity of Fluid A = dynamic viscosity / density of fluid A

                                            = 0.21 / 1650 = 1.2727 * 10^-4 m^2/sec

Convert to stokes = 1.2727 stokes

4 0
3 years ago
Fibonacci sequence has many applications in Computer Science. Write a program to generate Fibonacci numbers as many as desired.
VikaD [51]

Answer:

The Python Code for Fibonacci Sequence is :

# Function for nth Fibonacci number  

def Fibonacci(n):  

if n<0:  

 print("Incorrect input")  

# First Fibonacci number is 0  

elif n==0:  

 return 0

# Second Fibonacci number is 1  

elif n==1:  

 return 1

else:  

 return Fibonacci(n-1)+Fibonacci(n-2)  

# Driver Program  

print(Fibonacci(9))  

Explanation:

The Fibonacci numbers are the numbers in the following integer sequence.

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……..

In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation

Fn = Fn-1 + Fn-2

with seed values

F0 = 0 and F1 = 1.

8 0
3 years ago
Read 2 more answers
The purification of hydrogen gas is possible by diffusion through a thin palladium sheet. Calculate the number of kilograms of h
diamong [38]

Answer:

M=0.0411 kg/h or 4.1*10^{-2} kg/h

Explanation:

We have to combine the following formula to find the mass yield:

M=JAt

M=-DAt(ΔC/Δx)

The diffusion coefficient : D=6.0*10^{-8} m/s^{2}

The area : A=0.25 m^{2}

Time : t=3600 s/h

ΔC: (0.64-3.0)kg/m^{3}

Δx: 3.1*10^{-3}m

Now substitute the  values

M=-DAt(ΔC/Δx)

M=-(6.0*10^{-8} m/s^{2})(0.25 m^{2})(3600 s/h)[(0.64-3.0kg/m^{3})(3.1*10^{-3}m)]

M=0.0411 kg/h or 4.1*10^{-2} kg/h

8 0
3 years ago
What are the chemical properties of metals
Grace [21]

Answer:

  • The density of metals are usually high
  • They are great conductors of heat
  • They are malleable and ductile

8 0
3 years ago
An equation used to evaluate vacuum filtration is Q = ΔpA2 α(VRw + ARf) , Where Q ≐ L3/T is the filtrate volume flow rate, Δp ≐
larisa86 [58]

Answer:

Explanation:

The explanations and answers are shown in the following attachments

6 0
3 years ago
Other questions:
  • Write an application named EnterUppercaseLetters that asks the user to type an uppercase letter from the keyboard. If the charac
    8·1 answer
  • During an experiment conducted in a room at 25°C, a laboratory assistant measures that a refrigerator that draws 2 kW of power h
    13·1 answer
  • Give the approximate temperature at which creep deformation becomes an important consideration for each of the following metals:
    5·1 answer
  • (a) The lattice constant of GaAs is 5.65 Å. Determine the number of Ga atoms andAs atoms per cm 3 .
    15·1 answer
  • Emergency plans are being formulated so that rapid action can be taken in the event of an equipment failure. It is predicted tha
    12·2 answers
  • How can input from multiple individuals improve design solutions for problems that occur because of a natural disaster, such as
    5·1 answer
  • What Is Photosynthesis ?​
    7·2 answers
  • Question 8 (1 point)
    5·1 answer
  • How old are legos? Who created them? Why did they create them?
    11·1 answer
  • Technician a s ays both an ohmmeter and a self-powered test light may be used to test for continuity. technician b says both may
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!