Question: C programming why isn't this program working right / SuperCalcV 1 . c by Sarah Place 9 / 2 2 / 2 4 #include int

C programming
why isn't this program working right
/ SuperCalcV1.c by Sarah Place 9/22/24
#include
int main(void)
{
printf("Jayhawk Supercomputer Usage Calculator by Sarah Place
");
int hoursUsed=0, minutesUsed=0, secondsUsed=0;
printf("Enter hours used as a whole number (0-100)");
scanf("%d",&hoursUsed);
printf("
Enter minutes used as a whole number (0-59)");
scanf("%d",&minutesUsed);
printf("
Enter seconds used as a whole number (0-59)");
scanf("%d",&secondsUsed);
int totalSeconds = hoursUsed *3600+ minutesUsed *60+ secondsUsed;
printf("
Total Seconds of Usage =%d
",totalSeconds);
float totalHours =(float)hoursUsed +(float)minutesUsed/60+(float)secondsUsed/3600;
printf("
Total Hours of Usage =%3.4f
",totalHours);
float totalDays =(float)hoursUsed/24+(float)minutesUsed/1440+(float)secondsUsed/86400;
printf("
Total Days of Usage =%3.4f
",totalDays);
float rate =0.0f;
if (totalSeconds <=3000){
printf("
Rate Per Second =0.67f");
}
else if (totalSeconds <=6000){
printf("
Rate Per Second =0.57f");
}
else if (totalSeconds <=9000){
printf("
Rate Per Second =0.47f");
}
else if (totalSeconds <=36000){
printf("
Rate Per Second =0.37f");
}
else{
printf("
Rate Per Second =0.27f");
}
printf("
Thanks for Using Jayhawk Supercomputer!");
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!