Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Suppose that you are planning to pay $7000 yearly for 2 years for a car, which i

ID: 3582256 • Letter: S

Question


Suppose that you are planning to pay $7000 yearly for 2 years for a car, which is $13,000 now. What would he the interest rates? You may use the formula below. O= A (1 + i)^n/i(1 + i)^n P is S$13,000. A is $7000 and n is 2 in this problem. Plug in the number by hand and use C code that contains the Bisection Method to find the root for the interest rate i. Use [0.001, 1] as the interval with maximum error epsilon lessthanorequalto 0.001 The percentage of light (L) passing trough the sea surface that penetrates specific depth)D) in clean ocean water is as follows:

Explanation / Answer

// This is c code for given question.
// the given equation will be simplified into following equation
// (13*i2) + (19*i) - 1 = 0
// Steps:
// 13000*(i)*(i+1)2 = 7000*[ (1+i)2 - 1]
//=>13000*(i)*(i+1)2 = 7000*[(i)(i+2)]
//=> 13((i+1)2) = 7*(i+2)
//=> (13*i2) + (19*i) - 1 = 0
#include <stdio.h>
float funct(float i)
{
   return (13*i*i) + (19*i) - 1;
}

int main()
{
   float a = 0.001;
   float b = 1.0;
   int max_iter = 20000;
   float epsilon = 0.001;
   while(1)
   {
     float p = a + (b-a)/2;
     float v = funct(p);
     if(v == 0 || (b-a)/2 < epsilon)
     {
        printf("%s %f ","The Value of i is: ",p);
        break;
     }
     if(funct(a)*v > 0)
     {
        a = p;
     }
     else
     {
        b = p;
     }

   }
   return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote