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