|
@ -17,6 +17,10 @@ void troubleshoot(int errorCode){ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
float initiateInterest(float principalAmount, float interest, float time){ |
|
|
|
|
|
return principalAmount*(1+(interest*time)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void calculateYearlyInterest(){ |
|
|
void calculateYearlyInterest(){ |
|
|
float principalAmount; |
|
|
float principalAmount; |
|
|
float interestPerYear; |
|
|
float interestPerYear; |
|
@ -42,7 +46,7 @@ void calculateYearlyInterest(){ |
|
|
|
|
|
|
|
|
float interestDecimal=interestPerYear/100; |
|
|
float interestDecimal=interestPerYear/100; |
|
|
|
|
|
|
|
|
float result= principalAmount*(1+(interestDecimal*timeInYears)); |
|
|
|
|
|
|
|
|
float result= initiateInterest(principalAmount,interestDecimal,timeInYears); |
|
|
printf("\nAmount with the interest is %.2f€.",result); |
|
|
printf("\nAmount with the interest is %.2f€.",result); |
|
|
} |
|
|
} |
|
|
void calculateMonthlyInterest(){ |
|
|
void calculateMonthlyInterest(){ |
|
@ -70,7 +74,7 @@ void calculateMonthlyInterest(){ |
|
|
|
|
|
|
|
|
float interestDecimal=interestPerMonth/100; |
|
|
float interestDecimal=interestPerMonth/100; |
|
|
|
|
|
|
|
|
float result= principalAmount*(1+(interestDecimal*timeInMonths)); |
|
|
|
|
|
|
|
|
float result= initiateInterest(principalAmount,interestDecimal,timeInMonths); |
|
|
printf("\nAmount with the interest is %.2f€.",result); |
|
|
printf("\nAmount with the interest is %.2f€.",result); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|