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
Turning a screw with a screwdriver pushes the screw into the wood. The force is __________ over many turns
IrinaK [193]

Answer:

repeated?

Explanation:

not really sure what type of answer choices you have

5 0
3 years ago
Multiply. Write the answer in simplest form. 1 3/10×1/8
kicyunya [14]

9514 1404 393

Answer:

  13/80

Explanation:

The product is ...

  (1 3/10)×(1/8) = (13/10)×(1/8) = (13×1)/(10×8) = 13/80

4 0
2 years ago
Technician A says that 5W-30 would be better to use than 20W-50 in most vehicles in
shtirl [24]
Technician is correct sorry if im wronghg
5 0
3 years ago
Read 2 more answers
Each of the following activities are commonly performed during the implementation of the Database Life Cycle (DBLC). Fill in the
kicyunya [14]
Yessiree I agree with yu cause yu are right
4 0
3 years ago
A lake has a carrying capacity of 10,000 fish. At the current level of fishing, 2,000 fish per year are taken with the catch uni
arlik [135]

Answer:

The population size would be p' = 5000

The yield would be    MaxYield = 2082 \ fishes \ per \ year

Explanation:

So in this problem we are going to be examining the application of a  population dynamics a fishing pond and stock fishing and objective would be to obtain the maximum sustainable yield and and the population of the fish at the obtained maximum sustainable yield,  so basically we would be applying an engineering solution to fishing

 

    So the current  yield which is mathematically represented as

                               \frac{dN}{dt} =   \frac{2000}{1 \ year }

 Where dN is the change in the number of fish

            and dt is the change in time

So in order to obtain the solution we need to obtain the  rate of growth

    For this we would be making use of the growth rate equation which is

                                      r = \frac{[\frac{dN}{dt}] }{N[1-\frac{N}{K} ]}

  Where N is the population of the fish which is given as 4,000 fishes

          and  K is the carrying capacity which is given as 10,000 fishes

             r is the growth rate

        Substituting these values into the equation

                              r = \frac{[\frac{2000}{year}] }{4000[1-\frac{4000}{10,000} ]}  =0.833

The maximum sustainable yield would be dependent on the growth rate an the carrying capacity and this mathematically represented as

                      Max Yield  = \frac{rK}{4} = \frac{(10,000)(0.833)}{4} = 2082 \ fishes \ per \ year

So since the maximum sustainable yield is 2082 then the the population need to be higher than 4,000 so in order to ensure a that this maximum yield the population size denoted by p' would be

                          p' = \frac{K}{2}  = \frac{10,000}{2}  = 5000\ fishes          

7 0
3 years ago
Read 2 more answers
Other questions:
  • Work-producing devices that operate on reversible processes deliver the most work, and work-consuming devices that operate on re
    6·1 answer
  • A fluid has a dynamic viscosity of 0.048 Pa.s and a specific gravity of 0.913. For the flow of such a fluid over a flat solid su
    10·1 answer
  • Define initial set and final set. Briefly discuss one method used to determine them. The following laboratory tests are performe
    12·1 answer
  • A rectangular block having dimensions 20 cm X 30 cm X 40 cm is subjected to a hydrostatic stress of -50 kPa (i.e. under compress
    15·1 answer
  • Is a street the same as a avenue
    10·2 answers
  • A student lives in an apartment with a floor area of 60 m2 and ceiling height of 1.8 m. The apartment has a fresh (outdoor) air
    14·1 answer
  • QUESTION:
    13·1 answer
  • What would happen if the brake pedal was released while the bleed screw was open during brake bleeding?
    7·1 answer
  • 15- Vipsana's Gyros House sells gyros. The cost of ingredients (pita, meat, spices, etc.) to make a gyro is $2.00. Vipsana pays
    10·1 answer
  • In a medical lab, Sandrine is working to isolate one element from a sample of liquid material. She uses a centrifuge, a machine
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!