Write a c++program that has three functions. The first writes toa file the temperatures recorded over 30 days of a month. Thesecond function reads data from the file into an array. The third,calculates and displays the average, maximum and minimumtemperatures recorded for the month. The main program presents theuser with a menu of two choices: 1. Save temperature data & 2.Calculate statistics Both choices start by asking the user for thefile name (to write to in the first choice and to read from in thesecond choice)
Solution
#include <iostream>
#include <fstream>
#include<string.h>
using namespace std;
class Temperature{
private:
int temperature[30]; //array to store temperature of 30
OR
OR