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
The percentage modulation of AM changes from 50% to 70%. Originally at 50% modulation, carrier power was 70 W. Now, determine th
adoni [48]

Answer:

What is percentage modulation in AM?

The percent modulation is defined as the ratio of the actual frequency deviation produced by the modulating signal to the maximum allowable frequency deviation.

3 0
2 years ago
Prove the following languages are nonregular, once using the pumping lemma and once using the Myhill-Nerode theorem. When using
VashaNatasha [74]

Answer:

For any string, we use s = xyz

Explanation:

The pumping lemma says that for any string s in the language, with length greater than the pumping length p, we can write s = xyz with |xy| ≤ p, such that xyi z is also in the language for every i ≥ 0. For the given language, we can take p = 2.

Here are the cases:

  • Consider any string a i b j c k in the language. If i = 1 or i > 2, we take x = \epsilon   and y = a. If i = 1, we must have j = k and adding any number of a’s still preserves the membership in the language. For i > 2, all strings obtained by pumping y as defined above, have two or more a’s and hence are always in the language.
  • For i = 2, we can take    and y = aa. Since the strings obtained by pumping in this case always have an even number of a’s, they are all in the language.
  • Finally, for the case i = 0, we take x = \epsilon  , and y = b if j > 0 and y = c otherwise. Since strings of the form b j c k are always in the language, we satisfy the conditions of the pumping lemma in this case as well.
8 0
3 years ago
Air at 293k and 1atm flow over a flat plate at 5m/s. The plate is 5m wide and 6m long. (a) Determine the boundary layer thicknes
loris [4]

Answer:

a). 8.67 x 10^{-3} m

b).0.3011 m

c).0.0719 m

d).0.2137 N

e).1.792 N

Explanation:

Given :

Temperature of air, T = 293 K

Air Velocity, U = 5 m/s

Length of the plate is L  = 6 m

Width of the plate is b = 5 m

Therefore Dynamic viscosity of air at temperature 293 K is, μ = 1.822 X 10^{-5} Pa-s

We know density of air is ρ = 1.21 kg /m^{3}

Now we can find the Reyonld no at x = 1 m from the leading edge

Re = \frac{\rho .U.x}{\mu }

Re = \frac{1.21 \times 5\times 1}{1.822\times 10^{-5} }

Re = 332052.6

Therefore the flow is laminar.

Hence boundary layer thickness is

δ = \frac{5.x}{\sqrt{Re}}

   = \frac{5\times 1}{\sqrt{332052.6}}

   = 8.67 x 10^{-3} m

a). Boundary layer thickness at x = 1 is δ = 8.67 X 10^{-3} m

b). Given Re = 100000

    Therefore the critical distance from the leading edge can be found by,

     Re = \frac{\rho .U.x}{\mu }

     100000 = \frac{1.21\times5\times x}{1.822 \times10^{-5}}

     x = 0.3011 m

c). Given x = 3 m from the leading edge

    The Reyonld no at x = 3 m from the leading edge

     Re = \frac{\rho .U.x}{\mu }

     Re = \frac{1.21 \times 5\times 3}{1.822\times 10^{-5} }

     Re = 996158.06

Therefore the flow is turbulent.

Therefore for a turbulent flow, boundary layer thickness is

    δ = \frac{0.38\times x}{Re^{\frac{1}{5}}}

       = \frac{0.38\times 3}{996158.06^{\frac{1}{5}}}

       = 0.0719 m

d). Distance from the leading edge upto which the flow will be laminar,

  Re = \frac{\rho \times U\times x}{\mu }

5 X 10^{5} = \frac{1.21 \times 5\times x}{1.822\times 10^{-5}}}

 x = 1.505 m

We know that the force acting on the plate is

F_{D} = \frac{1}{2}\times C_{D}\times \rho \times A\times U^{2}

and C_{D} at x= 1.505 for a laminar flow is = \frac{1.328}{\sqrt{Re}}

                                                                         = \frac{1.328}{\sqrt{5\times10 ^{5}}}

                                                                       = 1.878 x 10^{-3}

Therefore, F_{D} =  \frac{1}{2}\times C_{D}\times \rho \times A\times U^{2}

                                          = \frac{1}{2}\times 1.878\times 10^{-3}\times 1.21\times (5\times 1.505)\times 5^{2}

                                         = 0.2137 N

e). The flow is turbulent at the end of the plate.

  Re = \frac{\rho \times U\times x}{\mu }

       = \frac{1.21 \times 5\times 6}{1.822\times 10^{-5} }

       = 1992316

Therefore C_{D} = \frac{0.072}{Re^{\frac{1}{5}}}

                                           = \frac{0.072}{1992316^{\frac{1}{5}}}

                                           = 3.95 x 10^{-3}

Therefore F_{D} = \frac{1}{2}\times C_{D}\times \rho\times A\times U^{2}

                                           = \frac{1}{2}\times 3.95\times 10^{-3}\times 1.21\times (5\times 6)\times 5^{2}

                                          = 1.792 N

3 0
3 years ago
¿Cuándo se formarán cristales en una mezcla que se está evaporando?
Georgia [21]
Answer - La cristalización ye un procesu químicu pol cual a partir d'un gas, un líquidu o una disolución, los iones, átomos o molécules establecen enllaces hasta formar una rede cristalina, la unidá básica d'un cristal. La cristalización emplegar con bastante frecuencia en química para purificar una sustancia sólida.
5 0
3 years ago
Many farms and ranches use electric fences to keep animals from getting into or out of specific pastures. When switched on, an e
Nikolay [14]

Answer:

Aluminum

Explanation:

The best material to use when creating an electric fence would be Aluminum. Aluminum wiring is incredibly durable and can be easily obtained. Since aluminum is a non-magnetic metal its conducting capabilities far exceed other metallic options in the market and is also why companies choose aluminum for their high tension cable wiring. Aside from being more expensive than other feasible options its durability and conducting capabilities make it easily the best option.

7 0
2 years ago
Read 2 more answers
Other questions:
  • For the R function shown below(Attachment):
    5·1 answer
  • Why excess air is required to burn a fuel completely
    8·2 answers
  • List five things the welding symbol will tell the welder about the weld that is to be made.​
    13·1 answer
  • You could be sued if you injure someone while rescuing them if...
    11·2 answers
  • Can someone help plz?!?
    5·2 answers
  • Different metabolic control systems have different characteristic time scales for a control response to be achieved. Match the t
    6·1 answer
  • How do engineering and technology impact the natural world and environment
    6·1 answer
  • A Styrofoam cup (k = 0.010 W/(m∙ o C)) has cross-sectional area (A) of 3.0 x 10 −2m 2 . The cup is 0.589 cm thick (L). The tempe
    12·1 answer
  • On some engines after torquing cylinder head fasteners you must
    12·1 answer
  • Who has the authority to declare a "global emergency"?​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!