Maria is collecting data on the daily temperatures in her city. She wants to use C++ vectors to keep track of these temperatures. Can you help her create/modify the collectTemperatures and calculateAverage function and to add temperatures to her vector and display the average temperature for the week? Below is the main function for your reference.
int main() {
// Collect daily temperatures using the collectTemperatures function
std::vector<int> temperatures = collectTemperatures();
// Calculate the average temperature using the calculateAverage function
double average = calculateAverage(temperatures);
// Display the average temperature for the week
std::cout << "Average temperature for the week: " << average << " degrees Celsius" << std::endl;
return 0;
}
You can use size method to determine the size of the vector