PLEASE HELP! calculate simple Interest based on the principle amount and time en
ID: 669187 • Letter: P
Question
PLEASE HELP!
calculate simple Interest based on the principle amount and time entered by the user. However the rate of interest depends on Random number in the program which ranges from 1 to 5.If the random number is less than 3 interest rate is 5 ,if it is between 3 and 5 interest rate is 10 and if it equal to and more than 5 interest rate is 15.
Follow the steps mentioned below to know about Random class and random number
The program also required to take string input from the user and say if it is even length or odd length
Explanation / Answer
main ()
{
int p,n,count;
float r,si;
count=1;
while(count<3)
{
printf(" enter values of p,n,r");
scanf("%d %d %d",&p,&n,&r);
si=p*n*r/100
printf("simple interest=Rs %f",si);
count=count+1;
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.