Hi there, I need some help with this program. I would love it if someone could u
ID: 3629998 • Letter: H
Question
Hi there,
I need some help with this program. I would love it if someone could use C, and not C++ PLEASE!
Write a program that estimates the temperature in a freezer (in degrees C) given the elapsed time (hours) since a power failure. Assume this temperature (T) is given by:
T = (38t /(t + 2)) 18
where t is the time since the power failure (in hours). Your program should prompt the user to enter how long it has been since the power failure in hours and minutes. Note that you will have to convert the elapsed time into hours. Your program should interact with the user in exactly this manner:
Enter time in hours and minutes=> 2 45
The elapsed time is 2.75 hours.
The temperature is 4.00 degrees C
Explanation / Answer
please rate - thanks
#include <stdio.h>
#include <conio.h>
int main()
{int hours, min;
double elapsed,temp;
printf("Enter time in hours and minutes=> ");
scanf("%d",&hours);
scanf("%d",&min);
elapsed=hours+min/60.;
temp=(38*elapsed/(elapsed+2))-18;
printf("The elapsed time is %.2f hours. ",elapsed);
printf("The temperature is %.2f degrees C ",temp);
getch();
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.