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
mr Goodwill [35]
3 years ago
8

Write a program that uses these bounds and bisection search (for more info check out the Wikipedia page on bisection search) to

find the smallest monthly payment to the cent (no more multiples of $10) such that we can pay off the debt within a year. Try it out with large inputs, and notice how fast it is (try the same large inputs in your solution to Problem 2 to compare!). Produce the same return value as you did in Problem 2.
Computers and Technology
1 answer:
Andrew [12]3 years ago
7 0

Answer:

I. i = 1

while i <= 12:

monthlyInterestRate = annualInterestRate/12.0

minimumMonthlyPayment = balance * monthlyPaymentRate

unpaidBalance = balance - minimumMonthlyPayment

updatedBalance = unpaidBalance + monthlyInterestRate * unpaidBalance

balance = updatedBalance

i += 1

print("The Remaining Balance is:" + " " + str(round(balance,2)))

II. monthlyInterestRate = annualInterestRate/12.0

fixedPayment = 10

def calculate(balance,monthlyInterestRate):

i = 1

while i <= 12:

unpaidBalance = balance - fixedPayment

balance = unpaidBalance + unpaidBalance * monthlyInterestRate

i += 1

return balance

while calculate(balance,monthlyInterestRate) > 0:

fixedPayment += 10

calculate(balance,monthlyInterestRate)

print("Lowest Payment is:" + " " + str(fixedPayment))

III.

initBalance = balance

monthlyInterestRate = annualInterestRate/12.0

low = balance/12.0

high = (balance * ((1.0 + monthlyInterestRate)**12))/12.0

epsilon = 0.01

minPay = (high + low)/2.0

month = 0

def calculate(month, balance, minPay, monthlyInterestRate):

while month <12:

unpaidBalance = balance - minPay

balance = unpaidBalance + (monthlyInterestRate * unpaidBalance)

month += 1

return balance

while abs(balance) >= epsilon:

balance = initBalance

month = 0

balance = calculate(month, balance, minPay, monthlyInterestRate)

if balance > 0:

low = minPay

else:

high = minPay

minPay = (high + low)/2.0

minPay = round(minPay,2)

print('Lowest Payment: ' + str(minPay))

Explanation:

I.Write a program to calculate the credit card balance after one year if a person only pays the minimum monthly payment required by the credit card company each month.

The following variables contain values as described below:

balance - the outstanding balance on the credit card

annualInterestRate - annual interest rate as a decimal

monthlyPaymentRate - minimum monthly payment rate as a decimal

For each month, calculate statements on the monthly payment and remaining balance. At the end of 12 months, print out the remaining balance. Be sure to print out no more than two decimal digits of accuracy

II.

Now write a program that calculates the minimum fixed monthly payment needed in order pay off a credit card balance within 12 months. By a fixed monthly payment, we mean a single number which does not change each month, but instead is a constant amount that will be paid each month.

In this problem, we will not be dealing with a minimum monthly payment rate.

The following variables contain values as described below:

balance - the outstanding balance on the credit card

annualInterestRate - annual interest rate as a decimal

III. In short:

Monthly interest rate = (Annual interest rate) / 12.0

Monthly payment lower bound = Balance / 12

Monthly payment upper bound = (Balance x (1 + Monthly interest rate)12) / 12.0

You might be interested in
To freeze rows 1 and 2, and columns 1, 2, and 3, which cell should you highlight before selecting freeze panes?.
Brilliant_brown [7]

In the case above, the cell that you can highlight before selecting freeze panes is row 3 column 4.

<h3>How do one freeze several column?</h3>

This can be done when a person select the column that's is said to be next to the right of the last column a person want to freeze.

Therefore, In the case above, the cell that you can highlight before selecting freeze panes is row 3 column 4.

Learn more about panes from

brainly.com/question/17194167

#SPJ1

4 0
2 years ago
 A network engineer is examining a configuration implemented by a new intern who attached an IP phone to a switch port and confi
lakkis [162]
Where is the answer?????????

7 0
3 years ago
You have implemented a network where each device provides shared files with all other devices, what kind of network is it?
Reil [10]

It is a Peer-to-peer type of network when you have implemented a network where each device provides shared files with all other devices.

So the answer is Peer-to-peer.

8 0
3 years ago
Next, Nate wants to add a date placeholder to his template. First, he places his insertion point a line before the company place
Debora [2.8K]

Explanation:

When using programs such as Microsoft and other similar products, things have been made so easy, with so many features, that you can make your document look good and interesting. For the case of Nate, he wants to add a date placeholder to his template, and the best way to do this is simply to click on the INSERT tab on the ribbon.

5 0
4 years ago
Dave and Kirk are learning about electromagnetic waves in class. Dave says that gamma rays are the most dangerous because they c
katen-ka-za [31]

I’d say A: Dave is partly right in his answer that gamma rays are the most dangerous, but it is because of their frequency and wavelength, not where they come from.

Gamma rays are the most intense and thus, most harmful electromagnetic waves. Gamma rays radiation poisoning is difficult to shield against. These rays have the most energy and can go through six feet of concrete and damage your DNA as well. The higher the energy waves (gamma, x-ray), the shorter the wavelengths

7 0
3 years ago
Other questions:
  • Which storage device would you most likely use to share a file with a classmate?
    11·2 answers
  • Explain the nature of documents that can be suitable for mergin
    12·1 answer
  • What is an individual section machine?
    14·1 answer
  • What are the main types of reading tools? Check all that apply. please HELP​
    15·1 answer
  • The length property of the String object returns
    15·1 answer
  • One of the main responsibilities employers have under OSHA is to:
    9·2 answers
  • Write a program that reads a list of integers into a vector, and outputs the two smallest integers in the list, in ascending ord
    5·1 answer
  • Match the image to its type.
    10·1 answer
  • PLEASE HELP
    12·1 answer
  • attackers typically use ack scans to get past a firewall or other filtering device. how does the process of an ack scan work to
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!