1. ## C++ Help

I am taking this C+ +programming class online and is really struggling learning the concept. Would someone be so kind to help me out with this problem:

A weather station will take 3 temperature readings each day for 7 days (Celsius) before reporting the aggregate data.
I would like to create a program that will read in the 21 Celsius temperature values and store the values in a two-dimensional array.
I would also like to create separate functions for the following tasks:
a. Calculate the average temperature
b. Calculate the high temperature
c. Calculate the low temperature
From the main function, I would like to call the functions created to retrieve the average, high, and low temperatures and display the results in both Fahrenheit and Celsius.
I would like to use the following formula to convert from Celsius to Fahrenheit:
Fahrenheit = Celsius * (212 – 32) / 100 + 32

This is what I came up with:

This won't compile. Is there someone that might have some
time to help me out, I really appreciate it.

#include <iostream>

using std::cin;
using std::cout;
using std::endl;

const int DAYS = 7;

// function prototypes
double c2f(double degreesC);

int main()
{

for (int day = 0; day < 7; ++day)
{
{

// you could make this more meaningful
// by including the day and reading in
// prompt.
cout << “Enter Celsius temperature: “;
}

}
cout << endl;
cout << “In degrees C:” << endl;
cout << “Avg temp is: “ << calculateAvg(cTemps) << endl;
cout << “Max temp is: “ << calculateHigh(cTemps) << endl;
cout << “Min temp is: “ << calculateMin(cTemps) << endl;

cout << endl;
cout << “In degrees F:” << endl;
cout << “Avg temp is: “ << c2f(calculateAvg(cTemps)) << endl;
cout << “Max temp is: “ << c2f(calculateHigh(cTemps)) << endl;
cout << “Min temp is: “ << c2f(calculateMin(cTemps)) << endl;

return 0; }
}
// function definitions omitted

2. This won't compile. Is there someone that might have some
How about telling us why it won't compile? (ie: Look at the reason why it won't compile. You compiler tells you this.) Post the first error message you get.

Use code tags. A number of people, me included, don't even bother reading code that doesn't use them. You didn't bother reading the forum rules, why should we bother helping?

Anyway, post the errors you're getting.

Quzah.

3. your passing to functions wrong... you can only pass one dimension of any array to a function... your trying to pass both dimensions...

4. Use code tags

Code:
```#include <iostream>

using std::cin;
using std::cout;
using std::endl;

const int DAYS = 7;

// function prototypes
double c2f(double degreesC);

int main()
{

for (int day = 0; day < 7; ++day)
{
{
// you could make this more meaningful
// by including the day and reading in
// prompt.
cout << “Enter Celsius temperature: “;
}
}
cout << endl;
cout << “In degrees C:” << endl;
cout << “Avg temp is: “ << calculateAvg(cTemps) << endl;
cout << “Max temp is: “ << calculateHigh(cTemps) << endl;
cout << “Min temp is: “ << calculateMin(cTemps) << endl;
cout << endl;
cout << “In degrees F:” << endl;
cout << “Avg temp is: “ << c2f(calculateAvg(cTemps)) << endl;
cout << “Max temp is: “ << c2f(calculateHigh(cTemps)) << endl;
cout << “Min temp is: “ << c2f(calculateMin(cTemps)) << endl;
return 0;
}```

5. A couple of things,

Code:
`cout << “Enter Celsius temperature: “;`
should be
Code:
`cout << "Enter Celsius temperature: ";`
Look at this function call here
Code:
`cout << “Min temp is: “ << calculateMin(cTemps) << endl;`
sure it's spelled correctly ? look at your prototypes..

You also got too many '}' in your program. You should really try to format your code better, it's a lot easier to spot such errors then.