in the first line after main, vector is in question.... it says it is 
undeclared and the < is a problem
  thanks
  bob
  
#include<iostream>
using namespace std;
  // compute mean (average) and median temperatures
int main()
{
vector<double> temps; // temperatures in Fahrenheit, e.g. 64.6
double temp;
while (cin>>temp) temps.push_back(temp); // read and put into vector
double sum = 0;
for (int i = 0; i< temps.size(); ++i) sum += temps[i];
// sums temperatures
cout << "Mean temperature: " << sum/temps.size() << endl;
sort(temps.begin(),temps.end());
cout << "Median temperature: " << temps[temps.size()/2] << endl;
}
  
Hw1.cpp: In function `int main()':
Hw1.cpp:8: `vector' undeclared (first use this function)
Hw1.cpp:8: (Each undeclared identifier is reported only once for each function
   it appears in.)
Hw1.cpp:8: parse error before `>' token
Hw1.cpp:10: `temps' undeclared (first use this function)

   

       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

[Non-text portions of this message have been removed]

Reply via email to