|
@ -8,12 +8,21 @@ float timeInYears; |
|
|
|
|
|
|
|
|
printf("Please enter the principal amount:"); |
|
|
printf("Please enter the principal amount:"); |
|
|
scanf("%f",&principalAmount); |
|
|
scanf("%f",&principalAmount); |
|
|
|
|
|
if(principalAmount<=0){ |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
printf("\nPlease enter interest per year (percentage):"); |
|
|
printf("\nPlease enter interest per year (percentage):"); |
|
|
scanf("%f",&interestPerYear); |
|
|
scanf("%f",&interestPerYear); |
|
|
|
|
|
if(interestPerYear<=0){ |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
printf("\nPlease enter interest time in years:"); |
|
|
printf("\nPlease enter interest time in years:"); |
|
|
scanf("%f",&timeInYears); |
|
|
scanf("%f",&timeInYears); |
|
|
|
|
|
if(timeInYears<=0){ |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
float interestDecimal=interestPerYear/100; |
|
|
float interestDecimal=interestPerYear/100; |
|
|
|
|
|
|
|
|