Question

On this project you will make calculations and conclusions based on real data collected by the...

On this project you will make calculations and conclusions based on real data collected by the NOAA (The National Oceanic and Atmospheric Administration, an agency of the United States government) on the “Daily Lake Average Surface Water Temperature” of six lakes (Ontario, Erie, Huron, Michigan, Superior, and St. Clair) during the 2017 calendar year. You can find the actual data file here that contain the average temperatures for each day of the year for each of the six lakes. Data were collected between January and December 2017 and are in degrees Celsius. https://coastwatch.glerl.noaa.gov/ftp/glsea/avgtemps/2017/glsea-temps2017_1024.dat Days are numbered 1 to 365, 1 being January 1st and December 31st being 365. You must use the C program to read the file and put the data into arrays. Download the file and clean it up to make it compatible – simply remove all lines above 2017 001 3.88 4.36 4.00 3.06 5.03 2.06 . Do not enter data by hand! Required elements: Each required element should have its own program (.c) file although one program with separate helper functions is also an excellent implementation. All computations to be done in C using the imported data file. 1. Calculate the yearly average temperature for each of the lakes, and the yearly average for all six lakes put together. 2. Indicate which lake is the coldest and which one is the warmest, based on the average yearly temperatures calculated in step #1. Also indicate which lakes have average temperatures above the average of all the lakes and which ones are below that same average. 3. Indicate the day and the temperature for the warmest water temperatures for each of the lakes. Do the same for the coldest temperatures. You must convert the day of the year value into a date/month format. 4. Indicate the day, lake and temperature of the warmest water temperature overall (all lakes combined). You must convert the day of the year value into a date/month format and indicate which lake. Do the same for the coldest temperature. 5. Calculate the summer average (day 172 to day 265) for all 6 lakes (one average per lake). Display the names of the lakes in order from warmest to coldest. Is the order from warmest to coldest the same as with the yearly average calculated in step #2? 6. Calculate the winter average (days 1 to 79 and days 355 to 365) for all 6 lakes (one average per lake). Display the names of the lakes in order from warmest to coldest. Is the order from warmest to coldest the same as with the yearly average calculated in step #2? 7. Assuming that you can swim comfortably in the lake if the temperature is above 20 degrees. Calculate the number of days in the year you can swim for each of the 6 lakes. 8. Assuming that lakes freeze when the water falls below 0 degrees. Calculate the number of days in the year that the lake is frozen.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Sample Output:

Code to be Copied:

//include required header files
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

//declare array size
#define MAX 367
//declare number of days in month in the year
int daysPerMonth[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

//Helper functions
void readDateFile(float Superior[], float Michigan[], float Huron[],
   float Erie[], float Ontario[], float StClair[]);
void yearlyAverageTemperature(float Superior[], float Michigan[], float Huron[], float Erie[],
   float Ontario[], float StClair[], float avg[]);
void yearlyColdestWarmest(float avg[]);
void warmestEachLake(float Superior[], float Michigan[], float Huron[],
   float Erie[], float Ontario[], float StClair[]);
void numberToDate(int num);
void coldestEachLake(float Superior[], float Michigan[], float Huron[],
   float Erie[], float Ontario[], float StClair[]);
void warmestColdestOverall(float Superior[], float Michigan[], float Huron[],
   float Erie[], float Ontario[], float StClair[]);
void sort(float avg[], char lake[6][20]);
void winterAverage(float Superior[], float Michigan[], float Huron[],
   float Erie[], float Ontario[], float StClair[]);
void swimComfortably(float Superior[], float Michigan[], float Huron[],
   float Erie[], float Ontario[], float StClair[]);
void lakesFreeze(float Superior[], float Michigan[], float Huron[],
   float Erie[], float Ontario[], float StClair[]);
void summerAverage(float Superior[], float Michigan[], float Huron[],
   float Erie[], float Ontario[], float StClair[]);

// main function
int main()
{
   // Declare arrays to store temperature
   float Superior[MAX], Michigan[MAX], Huron[MAX], Erie[MAX], Ontario[MAX], StClair[MAX];

   // decalre variable to store the average for each lake
   float average[6];

   // Call the function to read file data and store it in respective arrays
   readDateFile(Superior, Michigan, Huron, Erie, Ontario, StClair);

   //1. Calculate the yearly average temperature
   //Call the function to displays yearly average temperature of each lake
   yearlyAverageTemperature(Superior, Michigan, Huron, Erie, Ontario, StClair, average);

   //2. Calculate coldest and warmest lakes.
   //Call the function to displays coldest and warmest lake
   yearlyColdestWarmest(average);

   //3.Call the function to displays warmest lake and day
   warmestEachLake(Superior, Michigan, Huron, Erie, Ontario, StClair);

   // Call the function to displays coldest lake and day
   coldestEachLake(Superior, Michigan, Huron, Erie, Ontario, StClair);

   //4. Call the function to displays overall coldest and warmest lake with day
   warmestColdestOverall(Superior, Michigan, Huron, Erie, Ontario, StClair);

   //5. Call the function to displays summer average of each lake
   summerAverage(Superior, Michigan, Huron, Erie, Ontario, StClair);

   //6. Call the function to displays winter average of each lake
   winterAverage(Superior, Michigan, Huron, Erie, Ontario, StClair);

   //7. Call the function to displays lake name having above 20 degree
   swimComfortably(Superior, Michigan, Huron, Erie, Ontario, StClair);

   //8. Call the function to displays lake name having less than 0 degree
   lakesFreeze(Superior, Michigan, Huron, Erie, Ontario, StClair);

}// End of main function

//Implement the function to read the data from the file
void readDateFile(float Superior[], float Michigan[], float Huron[],
   float Erie[], float Ontario[], float StClair[])
{
   //count num records
   int i = 0;
   char heading[80];
   int year, day = 0;

   // Creates a file pointer to open the file glsea-temps2017_1024.dat in read mode
   FILE *fpK = fopen("glsea-temps2017_1024.dat", "r");

   // Checks if file is unable to open then display error message
   if (fpK == NULL)
   {
       // Display error message
       puts("Error: Could not open the input file");
       exit(0);
   }// End of if

   // Extracts dates from file and stores
   //it in structure object
   while (!feof(fpK))
   {
       // Extracts a temperature and stores it in counter index position of respective arrays
       fscanf(fpK, "%d %d %f %f %f %f %f %f", &year, &day, &Superior[i], &Michigan[i], &Huron[i],
           &Erie[i], &Ontario[i], &StClair[i]);
       // Increase the record counter by one
       i++;
   }// End of while loop
   // Close the file
   fclose(fpK);
}// End of function

//implement method compute the yearly average temperature
void yearlyAverageTemperature(float Superior[], float Michigan[], float Huron[],
   float Erie[], float Ontario[], float StClair[], float avg[])
{
   //decalre local variables
   int i = 0;
   float completeAverage, completeTotal = 0, tot[6] = { 0 };

   // Loops for 365 days
   for (i = 0; i < 363; i++)
   {
       tot[0] += Superior[i];
       tot[1] += Michigan[i];
       tot[2] += Huron[i];
       tot[3] += Erie[i];
       tot[4] += Ontario[i];
       tot[5] += StClair[i];
   }// End of for loop

   //compute overall average
   for (i = 0; i < 6; i++)
   {
       avg[i] = tot[i] / 365.0f;
   }
   //compute overall average for the average of lakes
   completeAverage = (avg[0] + avg[1] + avg[2] + avg[2] + avg[3] + avg[4] + avg[5]) / 7.0;

   //print each average for each lake
   printf("\n Superior Average = %.2f \n Michigan Average = %.2f \n Huron Average = %.2f \
   \n Erie Average = %.2f \n Ontario Average = %.2f \n StClair Average = %.2f",
       avg[0], avg[1], avg[2], avg[3], avg[4], avg[5]);
   //print overall average for all the lakes
   printf("\n Yearly average for all six lakes = %.2f\n\n", completeAverage);
}// End of function

//Implement method YearlyColdestWarmest
void yearlyColdestWarmest(float avg[])
{
   //compare each average and print if the lake is coldest or warmest
   if (avg[0] < avg[1] && avg[0] < avg[2] && avg[0] < avg[3] &&
       avg[0] < avg[4] && avg[0] < avg[5])
       printf("\n Coldest lake: %s \n Having average = %.2f", "Superior", avg[0]);
   else if (avg[1] < avg[2] && avg[1] < avg[3] && avg[1] < avg[4] &&
       avg[1] < avg[5])
       printf("\n Coldest lake: %s \n Having average = %.2f", "Michigan", avg[1]);
   else if (avg[2] < avg[3] && avg[2] < avg[4] && avg[2] < avg[5])
       printf("\n Coldest lake: %s \n Having average = %.2f", "Huron", avg[2]);
   else if (avg[3] < avg[4] && avg[3] < avg[5])
       printf("\n Coldest lake: %s \n Having average = %.2f", "Erie", avg[3]);
   else if (avg[4] < avg[5])
       printf("\n Coldest lake: %s \n Having average = %.2f", "Ontario", avg[4]);
   else
       printf("\n Coldest lake: %s \n Having average = %.2f", "StClair", avg[5]);
   if (avg[0] > avg[1] && avg[0] > avg[2] && avg[0] > avg[3] && avg[0] > avg[4] &&
       avg[0] > avg[5])
       printf("\n Warmest lake: %s \n Having average = %.2f", "Superior", avg[0]);
   else if (avg[1] > avg[2] && avg[1] > avg[3] && avg[1] > avg[4] && avg[1] > avg[5])
       printf("\n Warmest lake: %s \n Having average = %.2f", "Michigan", avg[1]);
   else if (avg[2] > avg[3] && avg[2] > avg[4] && avg[2] > avg[5])
       printf("\n Warmest lake: %s \n Having average = %.2f", "Huron", avg[2]);
   else if (avg[3] > avg[4] && avg[3] > avg[5])
       printf("\n Warmest lake: %s \n Having average = %.2f", "Erie", avg[3]);
   else if (avg[4] > avg[5])
       printf("\n Warmest lake: %s \n Having average = %.2f", "Ontario", avg[4]);
   else
       printf("\n Warmest lake: %s \n Having average = %.2f", "StClair", avg[5]);
}// End of function


//Implement method warmestEachLake
void warmestEachLake(float Superior[], float Michigan[], float Huron[], float Erie[], float Ontario[], float StClair[])
{
   int i;
   float warmTempOntario, warmTempErie, warmTempHuron, warmTempMichigan, warmTempSuperior, warmTempStClair;
   warmTempOntario = warmTempErie = warmTempHuron = warmTempMichigan = warmTempSuperior = warmTempStClair = 0.0f;

   int warmDayOntario, warmDayErie, warmDayHuron, warmDayMichigan, warmDaySuperior, warmDayStClair;

   // Loops for 365 days
   for (i = 0; i < 365; i++)
   {
       if (Ontario[i] > warmTempOntario)
       {
           warmTempOntario = Ontario[i];
           warmDayOntario = i;
       }// End of if condition
       if (Erie[i] > warmTempErie)
       {
           warmTempErie = Erie[i];
           warmDayErie = i;
       }// End of if condition
       if (Huron[i] > warmTempHuron)
       {
           warmTempHuron = Huron[i];
           warmDayHuron = i;
       }// End of if condition
       if (Michigan[i] > warmTempMichigan)
       {
           warmTempMichigan = Michigan[i];
           warmDayMichigan = i;
       }// End of if condition
       if (Superior[i] > warmTempSuperior)
       {
           warmTempSuperior = Superior[i];
           warmDaySuperior = i;
       }// End of if condition
       if (StClair[i] > warmTempStClair)
       {
           warmTempStClair = StClair[i];
           warmDayStClair = i;
       }// End of if condition
   }// End of for loop
   //print the results
   printf("\n\n Lake Ontario warmest water temperature %.2f ", warmTempOntario);
   numberToDate(warmDayOntario);
   printf("\n Lake Erie warmest water temperature %.2f", warmTempErie);
   numberToDate(warmDayErie);
   printf("\n Lake Huron warmest water temperature %.2f", warmTempHuron);
   numberToDate(warmDayHuron);
   printf("\n Lake Michigan warmest water temperature %.2f ", warmTempMichigan);
   numberToDate(warmDayMichigan);
   printf("\n Lake Superior warmest water temperature %.2f ", warmTempSuperior);
   numberToDate(warmDaySuperior);
   printf("\n Lake StClair warmest water temperature %.2f ", warmTempStClair);
   numberToDate(warmDayStClair);
}// End of function

//Based on the day's number,
//calculate which date and month that number
void numberToDate(int num)
{
   //declare local variable
   int i;
   for (i = 0; i < 12; i++)
   {
       //if the date number is greater than the number of days
       //in the current month, then that date
       //does not belong to this month else, it belongs to this month.
       if (num > daysPerMonth[i])
       {
           num -= daysPerMonth[i];
       }
       else
       {
           printf(" Day: %d/%d ", num, i + 1);
           break;
       }
   }
}

//implement method coldestEachLake
void coldestEachLake(float Superior[], float Michigan[], float Huron[], float Erie[],
   float Ontario[], float StClair[])
{
   //declare local variables
   int i;
   float coldTempOntario, coldTempErie, coldTempHuron, coldTempMichigan,
       coldTempSuperior, coldTempStClair;
   coldTempOntario = coldTempErie = coldTempHuron =
       coldTempMichigan = coldTempSuperior = coldTempStClair = 100.0;
   int coldDayOntario, coldDayErie, coldDayHuron, coldDayMichigan,
       coldDaySuperior, coldDayStClair;

   // Loops for 365 days
   for (i = 0; i < 365; i++)
   {
       if (Ontario[i] < coldTempOntario)
       {
           coldTempOntario = Ontario[i];
           coldDayOntario = i;
       }// End of if condition
       if (Erie[i] <= coldTempErie)
       {
           coldTempErie = Erie[i];
           coldDayErie = i;
       }// End of if condition
       if (Huron[i] <= coldTempHuron)
       {
           coldTempHuron = Huron[i];
           coldDayHuron = i;
       }// End of if condition
       if (Michigan[i] <= coldTempMichigan)
       {
           coldTempMichigan = Michigan[i];
           coldDayMichigan = i;
       }// End of if condition
       if (Superior[i] <= coldTempSuperior)
       {
           coldTempSuperior = Superior[i];
           coldDaySuperior = i;
       }// End of if condition
       if (StClair[i] <= coldTempStClair)
       {
           coldTempStClair = StClair[i];
           coldDayStClair = i;
       }// End of if condition
   }// End of for loop

   printf("\n\n Lake Ontario coldest water temperature %.2f ", coldTempOntario);
   numberToDate(coldDayOntario);
   printf("\n Lake Erie coldest water temperature %.2f", coldTempErie);
   numberToDate(coldDayErie);
   printf("\n Lake Huron coldest water temperature %.2f", coldTempHuron);
   numberToDate(coldDayHuron);
   printf("\n Lake Michigan coldest water temperature %.2f ", coldTempMichigan);
   numberToDate(coldDayMichigan);
   printf("\n Lake Superior coldest water temperature %.2f ", coldTempSuperior);
   numberToDate(coldDaySuperior);
   printf("\n Lake StClair coldest water temperature %.2f ", coldTempStClair);
   numberToDate(coldDayStClair);
}// End of function

//implement function warmestColdestOverall
void warmestColdestOverall(float Superior[], float Michigan[], float Huron[],
   float Erie[], float Ontario[], float StClair[])
{
   int i;
   float warmTemp = 0.0f, coldTemp = 500.0f;
   int warmDay, coldDay;
   char *warmLake = NULL, *coldLake = NULL;

   // Loops for 365 days
   for (i = 0; i < 365; i++)
   {
       if (Ontario[i] > warmTemp)
       {
           warmLake = "Ontario";
           warmTemp = Ontario[i];
           warmDay = i;
       }// End of if condition

       if (Ontario[i] < coldTemp)
       {
           coldLake = "Ontario";
           coldTemp = Ontario[i];
           coldDay = i;
       }// End of if condition
   }// End of for loop

   // Loops for 365 days
   for (i = 0; i < 365; i++)
   {
       if (Erie[i] > warmTemp)
       {
           warmLake = "Erie";
           warmTemp = Erie[i];
           warmDay = i;
       }// End of if condition

       if (Erie[i] < coldTemp)
       {
           coldLake = "Erie";
           coldTemp = Erie[i];
           coldDay = i;
       }// End of if condition
   }// End of for loop

   // Loops for 365 days
   for (i = 0; i < 365; i++)
   {
       if (Huron[i] > warmTemp)
       {
           warmLake = "Huron";
           warmTemp = Huron[i];
           warmDay = i;
       }// End of if condition

       if (Huron[i] < coldTemp)
       {
           coldLake = "Huron";
           coldTemp = Huron[i];
           coldDay = i;
       }// End of if condition
   }// End of for loop

   // Loops for 365 days
   for (i = 0; i < 365; i++)
   {
       if (Michigan[i] > warmTemp)
       {
           warmLake = "Michigan";
           warmTemp = Michigan[i];
           warmDay = i;
       }// End of if condition

       if (Michigan[i] < coldTemp)
       {
           coldLake = "Michigan";
           coldTemp = Michigan[i];
           coldDay = i;
       }// End of if condition
   }// End of for loop

   // Loops for 365 days
   for (i = 0; i < 365; i++)
   {
       if (Superior[i] > warmTemp)
       {
           warmLake = "Superior";
           warmTemp = Superior[i];
           warmDay = i;
       }// End of if condition

       if (Superior[i] < coldTemp)
       {
           coldLake = "Superior";
           coldTemp = Superior[i];
           coldDay = i;
       }// End of if condition
   }// End of for loop

   // Loops for 365 days
   for (i = 0; i < 365; i++)
   {
       if (StClair[i] > warmTemp)
       {
           warmLake = "StClair";
           warmTemp = StClair[i];
           warmDay = i;
       }// End of if condition

       if (StClair[i] < coldTemp)
       {
           coldLake = "StClair";
           coldTemp = StClair[i];
           coldDay = i;
       }// End of if condition
   }// End of for loop
   printf("\n\n Warmest water temperature overall Day: %d Lake: %s Temperature: %.2f",
       (warmDay + 1), warmLake, warmTemp);
   printf("\n Coldest water temperature overall Day: %d Lake: %s Temperature: %.2f",
       (coldDay + 1), coldLake, coldTemp);
}// End of function

//sort the temperatures based on the averages
void sort(float avg[], char lake[6][20])
{
   //decalre local variables
   int i, j;
   char templ[20];

   // Loops 6 times for 6 lakes
   for (i = 0; i < 6; i++)
   {
       // Loops till 6 minus outer loop variable (because
       //after each iteration one record is sorted)
       for (j = 0; j < 6 - i - 1; j++)
       {
           if (avg[j] < avg[j + 1])
           {
               float temp = avg[j];
               avg[j] = avg[j + 1];
               avg[j + 1] = temp;

               strcpy(templ, lake[j]);
               strcpy(lake[j], lake[j + 1]);
               strcpy(lake[j + 1], templ);
           }// End of if condition
       }// End of inner for loop
   }// End of outer for loop
}// End of function

//implement the function to find the summer average
void summerAverage(float Superior[], float Michigan[], float Huron[],
   float Erie[], float Ontario[], float StClair[])
{
   //declare local variables
   int i;
   float average[6];
   float total[6] = { 0 };
   char lake[6][20] = { "Superior", "Michigan", "Huron", "Erie", "Ontario", "StClair" };

   // Loops from 171 to 264
   //(because array index position begins from 0)
   for (i = 171; i < 264; i++)
   {
       total[0] += Superior[i];
       total[1] += Michigan[i];
       total[2] += Huron[i];
       total[3] += Erie[i];
       total[4] += Ontario[i];
       total[5] += StClair[i];
   }// End of for loop

   // Loops 6 times for 6 lakes
   for (i = 0; i < 6; i++)
   {
       average[i] = total[i] / (float)(265 - 172);
   }
   sort(average, lake);
   printf("\n\n Summer Warmest to Coldest");
   for (i = 0; i < 6; i++)
   {
       printf("\n Lake: %-20s Temperature: %.2f", lake[i], average[i]);
   }
}// End of function

//implement the fucntion to find winter average
void winterAverage(float Superior[], float Michigan[], float Huron[],
   float Erie[], float Ontario[], float StClair[])
{
   int i;
   float average[6];
   float total[6] = { 0 };
   char lake[6][20] = { "Superior", "Michigan", "Huron", "Erie", "Ontario", "StClair" };

   // Loops for 79 days from 1 to 78 (because array index position begins from 0)
   for (i = 0; i < 78; i++)
   {
       total[0] += Superior[i];
       total[1] += Michigan[i];
       total[2] += Huron[i];
       total[3] += Erie[i];
       total[4] += Ontario[i];
       total[5] += StClair[i];
   }// End of for loop

   // Loops for 10 days from 355 to 364 (because array index position begins from 0)
   for (i = 354; i < 364; i++)
   {
       total[0] += Superior[i];
       total[1] += Michigan[i];
       total[2] += Huron[i];
       total[3] += Erie[i];
       total[4] += Ontario[i];
       total[5] += StClair[i];
   }// End of for loop
   for (i = 0; i < 6; i++)
   {
       average[i] = total[i] / (float)(79 + 10);
   }
   sort(average, lake);
   printf("\n\n Winter Warmest to Coldest");
   for (i = 0; i < 6; i++)
   {
       printf("\n Lake: %-20s Temperature: %.2f", lake[i], average[i]);
   }
}// End of function

//implement the function swimComfortably
void swimComfortably(float Superior[], float Michigan[], float Huron[],
   float Erie[], float Ontario[], float StClair[])
{
   //declare local variables
   int i;
   int days[6] = { 0 };
   char lake[6][20] = { "Superior", "Michigan", "Huron", "Erie", "Ontario", "StClair" };

   // Loops for 365 days
   for (i = 0; i < 365; i++)
   {
       if (Superior[i] > 20)
           days[0]++;
       if (Michigan[i] > 20)
           days[1]++;
       if (Huron[i] > 20)
           days[2]++;
       if (Erie[i] > 20)
           days[3]++;
       if (Ontario[i] > 20)
           days[4]++;
       if (StClair[i] > 20)
           days[5]++;
   }// End of for loop
   printf("\n\n Swim comfortably in the lake ");
   for (i = 0; i < 6; i++)
   {
       printf("\n Lake %s Days = %d", lake[i], days[i]);
   }
}// End of function


//implemebt the function to compute number of days in Freeze
void lakesFreeze(float Superior[], float Michigan[], float Huron[],
   float Erie[], float Ontario[], float StClair[])
{
   //declare local variables
   int i;
   int days[6] = { 0 };
   char lake[6][20] = { "Superior", "Michigan", "Huron", "Erie", "Ontario", "StClair" };

   // Loops for 0 to 365 days
   for (i = 0; i < 365; i++)
   {
       if (Superior[i] < 0)
           days[0]++;
       if (Michigan[i] < 0)
           days[1]++;
       if (Huron[i] < 0)
           days[2]++;
       if (Erie[i] < 0)
           days[3]++;
       if (Ontario[i] < 0)
           days[4]++;
       if (StClair[i] < 0)
           days[5]++;
   }// End of for loop
   printf("\n\n Lakes freeze ");
   for (i = 0; i < 6; i++)
   {
       printf("\n Lake %s Days = %d", lake[i], days[i]);
   }
   printf("\n\n");
}// End of function

Add a comment
Know the answer?
Add Answer to:
On this project you will make calculations and conclusions based on real data collected by the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • On this project you will make calculations and conclusions based on real data collected by the...

    On this project you will make calculations and conclusions based on real data collected by the NOAA (The National Oceanic and Atmospheric Administration, an agency of the United States government) on the “Daily Lake Average Surface Water Temperature” of six lakes (Ontario, Erie, Huron, Michigan, Superior, and St. Clair) during the 2019 calendar year. You can find the actual data file here that contain the average temperatures for each day of the year for each of the six lakes. Data...

  • Computer Science

    https://coastwatch.glerl.noaa.gov/ftp/glsea/avgtemps/2020/glsea-temps2020_1024.datIt is up to you to extract the data from the file and put it into MATLAB. This operation must be done with MATLAB! Do not copy and enter data by hand! You are to make a report showing tables, graphs and conclusions based on data using MATLAB functionality. Required elements: The entire project must be presented as one single script file . Divide your codes into sections, one for each question, and add text comments to identify which question...

  • Write a C++ program that demonstrates use of programmer-defined data structures (structs), an array of structs, passing...

    Write a C++ program that demonstrates use of programmer-defined data structures (structs), an array of structs, passing an array of structs to a function, and returning a struct as the value of a function. A function in the program should read several rows of data from a text file. (The data file should accompany this assignment.) Each row of the file contains a month name, a high temperature, and a low temperature. The main program should call another function which...

  • INTRODUCTION You are working on development of a new power plant for Centerville, USA. Average monthly...

    INTRODUCTION You are working on development of a new power plant for Centerville, USA. Average monthly temperature data has been collected as part of designing the new power plant, and you are required to develop a computer program that will perform averaging analysis. The input data file is called temp. As you examine the input file, you notice that the first record line is the name of the city and type of data, the second record line contains the control...

  • Problem: You will write a program a C++ to compute some statistics based on monthly average...

    Problem: You will write a program a C++ to compute some statistics based on monthly average temperatures for a given month in each of the years 1901 to 2016. The data for the average August temperatures in the US has been downloaded from the Climate Change Knowledge Portal, and placed in a file named “tempAugData.txt”, available on the class website. The file contains a sequence of 116 values. The temperatures are in order, so that the first one is for...

  • Problem: You will write a program to compute some statistics based on monthly average temperatures for...

    Problem: You will write a program to compute some statistics based on monthly average temperatures for a given month in each of the years 1901 to 2016. The data for the average August temperatures in the US has been downloaded from the Climate Change Knowledge Portal, and placed in a file named “tempAugData.txt”, available on the class website. The file contains a sequence of 116 values. The temperatures are in order, so that the first one is for 1901, the...

  • package week_4; import static input.InputUtils.*; /** * You are a runner, and you are in training...

    package week_4; import static input.InputUtils.*; /** * You are a runner, and you are in training for a race. You'd like to keep track of all of your times for your training runs. You only like to run around lakes. Here's some example data. For this program, we'll assume that these are decimal values of minutes, not minutes and seconds, and the math will be more straightforward. Cedar, 45.15 Cedar, 43.32 Harriet, 49.34 Harriet, 44.43 Harriet, 46.22 Como, 32.11 Como,...

  • need help finiding slope and placement for the farenheit in the eaquation for a java.util.Scanner COMP163...

    need help finiding slope and placement for the farenheit in the eaquation for a java.util.Scanner COMP163 Greensboro Weather Trends There has been significant debate about global warming. Instead of answering the big question, your program is to determine if (and by how much) Greensboro has been warming for the past few decades. For this assignment you are to write a program that reads a file created with data from the National Climatic Data Center to determine the average annual minimum...

  • need help Instructions Assume we collected weather temperature data from a city for 5 day, Mon...

    need help Instructions Assume we collected weather temperature data from a city for 5 day, Mon thru Fri. The data is record in a 10 array. Each day is represented with 3 data points. So, create an array with 15 "unsigned short" items, and fill this array with random numbers from 32 to 120. Let's call this array temp array. Then create a structure to keep 1) name of day, and 2) average of temp of this array. Since we...

  • ENGR 200 FALL 2019 P8: TEMPERATURE ANALYSIS (input/output files, if structures, for loops, two-dimensional array, one-dimensional...

    ENGR 200 FALL 2019 P8: TEMPERATURE ANALYSIS (input/output files, if structures, for loops, two-dimensional array, one-dimensional character array) DUE: November 14, 2019, at 11:59 p.m. US Central Time POINTS: 70 INTRODUCTION: You are working on development of a new power plant for Centerville, USA. Average monthly temperature data has been collected as part of designing the new power plant, and you are required to develop a computer program that will perform averaging analysis. The input data file is called temp....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT