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
WHAT ARE THE MOST USED AND POPULAR PROCESSOR
den301095 [7]

Answer:

As you shop around for computers, you'll notice certain processor names that continually pop up. One of the most common is the Intel® Core™ series: the i3 processor, i5 processor, and i7 processor. As the names suggest, the i3 processor is less powerful than the i5, and the i7 is the most powerful of the three.

hope helpful <3

8 0
3 years ago
Read 2 more answers
project-1 Write a class called Person that has two data members - the person's name and age. It should have an init method that
MArishka [77]
Hello how are you today
4 0
3 years ago
Which method is used to edit a function that has been created and inserted into a cell?
8_murik_8 [283]

Answer:

A

Explanation:

A

4 0
3 years ago
Read 2 more answers
In cell i5, enter a formula to calculate the total admission fees collected for the 2018 altamonte springs job fair using a mixe
nika2105 [10]

The formula is to calculate the total admission fees collected is = F5*B14

1. Click on cell I5

2. Type equal sign =

3. Type F5 or click on F5 cell

3. Type multiplication sign *

4. Type B14 or click on B14 cell

4 0
4 years ago
Read 2 more answers
You are going to create an application that will run 5 different programs. this program will be driven by a menu screen. the use
Zielflug [23.3K]
You have to multiply 59times 5 and that will give u ?????
4 0
4 years ago
Other questions:
  • Study the sentence below. Highlighting a word, phrase, or a sentence is used to emphasize or CALL ATTENTION to the text Which wo
    10·1 answer
  • All of the following are report sections EXCEPT (Points : 4) detail.
    11·1 answer
  • The ____________________ packet-filtering firewall allows only a particular packet with a particular source, destination, and po
    10·1 answer
  • \Read the sentence.
    12·1 answer
  • How many bytes are in 1 kilobyte of storage
    13·1 answer
  • What is another term used for data dictionary?
    12·1 answer
  • The ACT science test takes___minutes.<br> A. 45<br> B. 30<br> C. 35<br> D. 60
    11·2 answers
  • Among the second generation home console companies,which managed to come out on top
    10·1 answer
  • Suppose a host has a 1-MB file that is to be sent to another host. The file takes 1 second of CPU time to compress 50%, or 2 sec
    12·1 answer
  • Which of the following actions would not reduce software piracy? reducing the cost of software. offering downloads of software.
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!