-
Language
C
-
Description
It computes the expected amount in The Credit Union And Bank. Where I is the interest rate, N is the number of years, and P is the Principal. Mr. Ojo wants to deposit =N= 1,500 at a savings institution. He considers a bank and a credit union. The credit union requires a non-refundable membership fee of =N=15. Deposits earn interest of 12.25 percent at the credit union and 11.75 percent in the bank. Mr. Ojo will need the money in 2 and half years. We wish to determine which institution that Mr. Ojo should use.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main (void)
{
float I_bank, I_the_credit_union, N, P, expected_amount_on_bank;
float expected_amount_on_the_credit_union, membership_fee;
N=2.5;
P=1500;
I_the_credit_union=0.1225;
I_bank=0.1175;
membership_fee=15;
expected_amount_on_the_credit_union=(P-membership_fee)*pow(1.0+I_the_credit_union,N);
expected_amount_on_bank=P*pow(1.0+I_bank,N);
if(expected_amount_on_the_credit_union>expected_amount_on_bank)
printf ("Mr. Ojo should save his money in The Credit Union.\n");
else
printf ("Mr. Ojo should save his money in Bank.\n");
printf ("Value of I bank: %g\n", I_bank);
printf ("Value of I the credit union: %g\n", I_the_credit_union);
printf ("Value of N: %g\n", N);
printf ("Value of P: %g\n", P);
printf ("Value of expected amount on bank: %g\n", expected_amount_on_bank);
printf ("Value of expected amount on the credit union: %g\n", expected_amount_on_the_credit_union);
printf ("Value of membership fee: %g\n", membership_fee);
putchar ('\n');
system ("pause");
return EXIT_SUCCESS;
}
#include <stdlib.h>
#include <math.h>
int main (void)
{
float I_bank, I_the_credit_union, N, P, expected_amount_on_bank;
float expected_amount_on_the_credit_union, membership_fee;
N=2.5;
P=1500;
I_the_credit_union=0.1225;
I_bank=0.1175;
membership_fee=15;
expected_amount_on_the_credit_union=(P-membership_fee)*pow(1.0+I_the_credit_union,N);
expected_amount_on_bank=P*pow(1.0+I_bank,N);
if(expected_amount_on_the_credit_union>expected_amount_on_bank)
printf ("Mr. Ojo should save his money in The Credit Union.\n");
else
printf ("Mr. Ojo should save his money in Bank.\n");
printf ("Value of I bank: %g\n", I_bank);
printf ("Value of I the credit union: %g\n", I_the_credit_union);
printf ("Value of N: %g\n", N);
printf ("Value of P: %g\n", P);
printf ("Value of expected amount on bank: %g\n", expected_amount_on_bank);
printf ("Value of expected amount on the credit union: %g\n", expected_amount_on_the_credit_union);
printf ("Value of membership fee: %g\n", membership_fee);
putchar ('\n');
system ("pause");
return EXIT_SUCCESS;
}