Instructions:
--For each day, tell which balloon (identify it by time released) traveled the greatest distance on that day (7 values printed). Identify the day by name rather than by number.
--For each day, calculate and print the average distance (print one decimal position) traveled by all balloons released on that day which were actually recovered hose for which distance > 0) (7 values printed). Identify the day by name rather than by number.
--Calculate and print the average distance (print one decimal position) traveled by all the balloons which were recovered during the entire week (1 value printed).
--I am pulling my information from a file where its listed like:
4 1200 182
4 1800 42
7 1500 284
first column means day
second column means time
third column means distance traveled
I am very new to c++ and still learning a lot. I am using bloodshed Dev c++ Thanks for your time
Here is my code: You don't have to tell me the answer I just need guidance on completing the program like should I use switch statements, more void function, etc.
double distance[DAYS][TIME]; // 2D array for storing the distance values
int day; // row subscript for distance array
int time; // column subscript for distance array
int max; // subscript for the largest distance in a row
double sum;
double totalSales;
getInfile (distance); // Input values to fill the store array.
printHeading(dayNum);
for (day = 0; day < DAYS; day++) // For each day
{
max = maxDistance (distance, day); // find the largest distance in distance array
sum = dayRelease(distance, day);
cout << setw(15) << left << timeRelease[TIME];
for (time = 0; time < TIME; time++)
cout << setw(10) << right << distance [day][time];
cout << setw(10) << sum << " " << left << dayNum[max] << endl;
}