So this program is supposed to estimate hourly temperatures throughout a day after being given the daily high, low and the hour which the low is expected. I am having problems calling up my functions inside the main function. I don't really understand how I am supposed to get specific information from the functions, and use it in place of a variable in my main function. I'm also having trouble grasping the idea of parameters and arguments. I'm sure I've messed up in more than one place here, but I'm mostly concerned about the functions right now. Any help would be appreciated.
#include <stdio.h>
#include <math.h>
#define PI 3.14159
double getFahrTemp(double high, double low, int hour);
double fahr2cels( double fahr );
double cels2kelv( double cels );
double fahr2rank( double fahr );
double getDailyHigh()
{
int high;
printf("Enter the daily high temperature <F>:\n");
scanf("%d",&high);
return high;
}
double getDailyLow()
{
int low;
printf("Enter the daily low temperature <F>:\n");
scanf("%d",&low);
return low;
}
int getLowHour()
{
int lowHour;
printf("Enter the time of the daily low temperature:\n");
scanf("%d",&lowHour);
return lowHour;
}
double getFahrTemp(double high, double low, int hour)
{
return (high-low)/2 * sin(2*PI/24 * hour + 3.0/2.0 * PI) + (high+low)/2;
}
double fahr2cels( double fahr )
{
double cels;
cels = fahr - 32 / 1.8;
}
double cels2kelv( double cels )
{
double kelv;
kelv = cels + 273;
}
double fahr2rank ( double fahr )
{
double rank;
rank = fahr + 459.67;
}
int main(getDailyHigh, getDailyLow, getLowHour, getFahrTemp)
{
int hour, time;
printf ("Temperature Scale Conversion Chart:\n")
printf ("TIME FAHR CELSIUS KELVIN RANKINE")
getDailyHigh();
getDailyLow();
getLowHour();
do
{
int time, hour=1;
time = (hour + lowHour) % 12;
getFahrTemp(getDailyHigh(), getDailyLow(), hour)
fahr2cels
cels2kelv
fahr2rank
printf ("%d:00 %2.2d %2.2d %3.2d %3.2d\n", time, fahr, cels, kelv, rank;
hour = hour++;
}
while (hour <= 24);
}