i need to create c++class to store temperature. class should store temperature(magnitude) and scale (celsius, fahrenheit)class should have constructors as well as member functions to return the temperature in either scale.
i got this so far but not sure if its right and its not finished
#include <iostream>
#include <cstdlib>
using namespace std;
class Temperature{
public:
enum TemperatureScale{
celsius,
fahrenheit
};
private:
double value;
TemperatureScale scale;
Try to use the code tags(lower right of post, "<>")
Im pretty use you're missing some code? you declare public twice in the code, a class should look like this:
1 2 3 4 5 6 7 8 9
Class classEX
{
public:
//.....
protected:
//....
private:
//...
};