You can change struct to class. I really dont get why you want to define TimePeriod as abstract. Also i would suggest making a linked list of type TimePeriod. Each item in the list would point to the next timeperiod item through the next
pointer.
struct TimeData
{
int minTemp;
int maxTemp;
public int setData(int minTemp,int maxTemp)
{
}
}
struct TimePeriod
{
Day d;//this is kinda redundant as it only contains one day
TimeData td;
TimePeriod *next;//to point to next TimePeriod object in the list
};
struct day
{
int d;
Hour h[24];
TimeData td;
int setTimeData()
{
//cycle through hour timedata and calculate avg or whatever you want
}
};
struct Hour
{
int h;
Min m[60];
TimeData td;
int setTimeData()
{
//cycle through min timedata and calculate avg or whatever you want
}
};
struct Min
{
int m;
TimeData td;
int setTimeData(int minTemp,int maxTemp)
{
//set TimeData td
}
};