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
Which of the following scan only works if operating system’s TCP/IP implementation is based on RFC 793?
Shkiper50 [21]

Answer:NULL Scan

Explanation:RFC 793(Request for comments) is a type of RFC command labeled with the number 793 which can operate with the TCP protocol.They are sort of document form which is from IETF( Internet Engineering Task Force ).

The null scan is scanning protocol used by legal as well as illegal hackers for working in the transfer control protocol architecture. It is used for the identification of the the ports and holes in TCP servers.they can also have the negative impact if used by the illegal hackers.

5 0
2 years ago
Which is the highest level of the hierarchy of needs model?
navik [9.2K]
I believe the answer is C.
5 0
3 years ago
Describe your dreams include lifestyle,job,house,friends
n200080 [17]
So, this is an answer of your choice. What it is trying to ask is tell us what your dream home, job, husband, and so on. For example: My dream home is a mansion in Mississippi by the beach. My dream job is a doctor. Those are prime examples of a dream home and job. Now your answer shouldn't be the same as mine. Your's should be something different. Unless, you want a mansion in Mississippi by the beach and you would like to be a doctor. In other words it is asking you to tell us what you want you home, lifestyle, job, friends, and possibly your DREAM pet. Hope this helps.

3 0
3 years ago
Read 2 more answers
How do I convince my mom to buy a gaming computer for me? She says we already have 3 other computers/laptops in the house to use
Natalka [10]

Answer: ??

Explanation: explain to her that you don't have your own. keep asking and convince her you're doing good in school, (if u are) and that you listen and you should be responsible to have your own

4 0
2 years ago
Which of the following is not a legal identifier?
Paraphin [41]

Answer:

321Go

Explanation:

The identifiers in C, C++, C#, Java and other programming languages are a combination of letters, numbers and the underscore symbol.  The laters versions of C and C++ allows you to use almost all Unicode characters. In Java, you can use also the dollar sign.

From that you have to be careful to follow these rules:

-Don't use keywords.

-Don't include white spaces.

-Don't use operators.

-Don't repeat identifiers.

-Don't start your identifier with a number.

-Don't use two consecutive underscores.

So app_234, happyTimesAhead, and cis22B are follo wing these rules but 321Go starts with a number.

4 0
3 years ago
Other questions:
  • The manager of a sports club has data about the club members' ages in a workbook. He wants to find which age is most common. Whi
    13·2 answers
  • Why students might want headsets for their computers?
    11·1 answer
  • When paying bills online, a payee is:
    9·1 answer
  • And what way do you mixed and market economy support the ideals of democracy​
    12·1 answer
  • What is the quickest option for adding internet images to a power point presentation
    7·1 answer
  • Due dates is the final date an assignment will be accepted. Plan ahead to ensure should you face difficulty with the assignment
    9·2 answers
  • 41. All the following software are examples of operating systems EXCEPT
    5·1 answer
  • What<br>are<br>the features of secondary storage media​
    13·2 answers
  • 4.2 Lesson Practice​
    8·2 answers
  • Households play a role in the circular flow of goods by
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!