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
Which type of memory is programmed at the factory? RAM ROM Cache or Virtual memory
12345 [234]

Answer:

RAM, which stands for random access memory, and ROM, which stands for read-only memory, are both present in your computer. RAM is volatile memory that temporarily stores the files you are working on. ROM is non-volatile memory that permanently stores instructions for your computer.

Explanation:

5 0
2 years ago
Which of the following are true about the American Wire Gauge?
harina [27]

Answer:

A. smallest wire is No. 12

7 0
2 years ago
What forces are not present in space
ss7ja [257]

Answer:

C.) Weight and distance I believe

Explanation:

7 0
3 years ago
Using Java..
uysha [10]

Answer:

The source code files for this question have been attached to this response.

Please download it and go through each of the class files.

The codes contain explanatory comments explaining important segments of the codes, kindly go through these comments.

Download java
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
7 0
3 years ago
Compute the theoretical density of ZnS given that the Zn-S distance and bond angle are 0.234 nm and 109.5o, respectively. The at
andriy [413]

Answer: the theoretical density is 4.1109 g/cm³

Explanation:  

first the image of one set of ZnS bonding in the crystal structure, we calculate the value of angle θ

θ + ∅ + 90° = 180°

θ = 90° - ∅

θ = 90° - ( 109.5° / 2 )

θ = 35.25°

next we calculate the value of x from the geometry

given that;  distance angle d = 0.234

x = dsinθ

= 0.234 × sin35.25°)

= 0.135 nm = 0.135 × 10⁻⁷ cm

next we calculate the length of the unit cell

a = 4x

a = 4(0.135)

a = 0.54 nm = 0.54 × 10⁻⁷ cm

next we calculate number of formula units

n' = (no of corner atoms in unit ell × contribution of each corner atom in unit cell) + ( no of face center atom in a unit cell × contribution of each face center atom in a unit cell)

n' = 8 × 1/8) + ( 6 × 1/2)

= 1 + 3

= 4

next we calculate the theoretical density using  this equation

P = [n'∑(Ac + AA)] / [Vc.NA]

= [n'∑(Ac + AA)] / [(a)³NA]

where the ∑Ac is sum of atomic weights of all cations in the formula unit( 65.41 g/mol)

∑AA is the sum of weights of all anions in the formula unit( 32.06 g/mol)

Na is the Avogadro’s number( 6.023 × 10²³ units/mole)

so we substitute

P = [4( 65.41 + 32.06)] / [ ( 0.54 × 10⁻⁷ )³ × (6.023 × 10²³)]

= 389.88 / 94.84

= 4.1109 g/cm³

therefore the theoretical density is 4.1109 g/cm³

5 0
2 years ago
Other questions:
  • List the thermal conductivities of five
    15·1 answer
  • I have a plot plan with an angle of 35 degrees on the main lot, how will this affect the construction of the basement
    9·1 answer
  • 7. Which power source is an important transition between
    7·1 answer
  • How to build a laser pointer?
    12·1 answer
  • Getting a haircut from a barber is an example of a service that can be purchased. Please select the best answer from the choices
    9·2 answers
  • Which type of blade is used with a demolition saw?
    11·1 answer
  • What was the most important thing you learned this school year in your engineering class and why did you choose this thing
    15·1 answer
  • Air enters a compressor operating at steady state at 1.05 bar, 300 K, with a volumetric flow rate of 21 m3/min and exits at 12 b
    11·1 answer
  • Most technician jobs in the field of metrology require a college degree. True or False?
    5·2 answers
  • Contrast moral and immoral creativity and innovation<br>​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!