Can someone write the code for me for:
Class Temperature
{
public:
void set(double new_degrees,char new_scale);
double get_degrees();
char get_scale();
private:
double degrees;
char scale;
thanks
[email protected]
Can someone write the code for me for:
Class Temperature
{
public:
void set(double new_degrees,char new_scale);
double get_degrees();
char get_scale();
private:
double degrees;
char scale;
thanks
[email protected]
um no
I'll help but I won't do...but only if you have some stuff done.
"The most common form of insanity is a combination of disordered passions and disordered intellect with gradations and variations almost infinite."
Yes please let me do it!!!!!!
oh but i will finish that section of code for you though
Code:Class Temperature { public: void set(double new_degrees,char new_scale); double get_degrees(); char get_scale(); private: double degrees; char scale; };
"The most common form of insanity is a combination of disordered passions and disordered intellect with gradations and variations almost infinite."
This is what i have so far...have worked a lot
on this(many hours) and cannot get it to compile...
#ifndef TEMPLIST_H
#define TEMPLIST_H
#include <iostream>
using namespace std;
namespace savitchtlist
{
const int MAX_LIST_SIZE = 50;
class TemperatureList
{
public:
TemperatureList();
void add_temperature(double temperature);
bool full() const;
friend ostream& operator <<(ostream& outs, const TemperatureList& the_object);
private:
double list[MAX_LIST_SIZE];
int size;
};
}
#endif
#include <iostream>
#include <cstdlib>
#include "templist.h"
using namespace std;
namespace savitchtlist
{
TemperatureList::TemperatureList()
{
size = 0;
}
void TemperatureList::add_temperature(double temperature)
{
if ( full() )
{
cout << "Error:adding to a full list.\n";
exit(1);
}
else
{
list[size] = temperature;
size = size + 1;
}
}
bool TemperatureList::full() const
{
return (size == MAX_LIST_SIZE);
}
ostream& operator <<(ostream& outs, const TemperatureList& the_object)
{
for (int i = 0; i < the_object.size; i++)
outs << the_object.list[i] << "F\n";
return outs;
}
}