#include
#include
#include
using namespace std;
class DailyTemp {
int temp;
public:
DailyTemp() { temp = 0; }
DailyTemp(int x) { temp = x; }
DailyTemp &operator=(int x) {
temp = x; return *this;
}
double get_temp() { return temp; }
};
bool operator<(DailyTemp a, DailyTemp b)
{
return a.get_temp() < b.get_temp();
}
bool operator==(DailyTemp a, DailyTemp b)
{
return a.get_temp() == b.get_temp();
}
int main()
{
vector v;
unsigned int i;
for(i=0; i<7; i++)
v.push_back(DailyTemp(60 + rand()%30));
cout << "Fahrenheit temperatures:\n";
for(i=0; i cout << v[i].get_temp() << " ";
cout << endl;
// convert from Fahrenheit to Centigrade
for(i=0; i v[i] = (int)(v[i].get_temp()-32) * 5/9 ;
cout << "Centigrade temperatures:\n";
for(i=0; i cout << v[i].get_temp() << " ";
return 0;
}