Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.91 KB | None | 0 0
  1. #include <stdio.h>
  2. #define TIME_IN_HOUR 60
  3.  
  4. int
  5. main()
  6. {
  7.     double temperature, time_hours, time_minutes, time_minutes_convert, time_convert;
  8.  
  9.     printf("Enter time since power failure (Hours then minutes)> ");
  10.     scanf("%lf%lf", &time_hours, &time_minutes);
  11.  
  12. /*  
  13.  *  Just displaying my Hours and Minutes for checking and debugging
  14.  *  printf("Hours: %.1f", time_hours);
  15.  *  printf(" Debug Minutes: %.2f\n", time_minutes);
  16.  */
  17.  
  18.     time_minutes_convert = time_minutes / 60.0;
  19.     time_convert = time_hours + time_minutes_convert;
  20.  
  21. /*  
  22.  *  Just displaying my conversion for checking and debugging
  23.  *  printf("Debug time since power faulure converting: %.1f\n", time_convert);
  24.  */
  25.  
  26.     temperature = ((4.0 * (time_convert * time_convert)) / (time_convert + 2.0) - 20.0);
  27.  
  28.     printf("Temperature in freezer after %.1f", time_convert);
  29.     printf(" hours: %.2f", temperature);
  30.     printf(" degrees celcius.\n");
  31.  
  32.     return (0);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement