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
Do you have to make a account of Windows 10?
shepuryov [24]

Answer: No!

Explanation: You can make your account where and whenever!

6 0
4 years ago
When a program lets the user know that an invalid choice has been made, this is known as:?
kirza4 [7]

When a program lets the user know that an invalid choice has been made, this is known as a error message.

7 0
3 years ago
A _____ is often used in Access to present a menu with command buttons that end users can click to perform various database acti
alexandr402 [8]

Answer:

Navigation form

Explanation:

7 0
4 years ago
Structured walk-throughs take place throughout the SDLC and are called _____ reviews, depending on the phase in which they occur
Tpy6a [65]

Answer:

design

Explanation:

Based on the information provided within the question it can be said that these are called design reviews. This is one of the most important parts of the development of a system. This focuses more on answering how something is going to be done in the system as opposed to answering what is going to be done for the system depending on the questions asked in the analysis phase.

5 0
3 years ago
Validation ensures that a website looks good.<br> True or False
Nezavi [6.7K]
The answer would be false. Validation doesn't have to do with a website looking good, validation is just checking the quality of the logic and backing up a statement with information that proves a statement to be true
8 0
3 years ago
Other questions:
  • Google wallet software utilizes android phones with near field communication technology, such as _____, to allow shoppers to swi
    12·1 answer
  • Each processor or core processes two threads at the same time is called _________.
    5·1 answer
  • What is the name of the subsystem that transfers data between components inside a pc or between pcs?
    12·1 answer
  • A(n) _____ is a computer network that uses Internet Protocol technology to share information, operational systems, or computing
    12·1 answer
  • An employee’s total weekly pay equals the hourly wage multiplied by the total number of regular hours plus any overtime pay. Ove
    13·1 answer
  • what are the benefits of VolP? select all that apply. A:cheaper printings B:clearer calls C: faster download D: increased effici
    11·2 answers
  • The entress Effie cooks as a chef never vary by taste, quantity or quality
    6·1 answer
  • How could you represent the following binary color in hexadecimal? What is its numerical value? What color is it? How
    13·1 answer
  • Create an application named SalesTransactionDemo that declares several SalesTransaction objects and displays their values and th
    12·1 answer
  • Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!