Thread: C++ 6.0

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    2

    Unhappy C++ 6.0

    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]

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    139
    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."

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    589
    Yes please let me do it!!!!!!

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    139
    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."

  5. #5
    Registered User
    Join Date
    Apr 2002
    Posts
    2
    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;
    }


    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling x64 code in VC++ 6.0?
    By cpjust in forum Windows Programming
    Replies: 7
    Last Post: 07-29-2008, 09:36 AM
  2. Visual C++ 6.0 Pro vs Visual C++ 6.0 Enterprise
    By Joelito in forum Tech Board
    Replies: 5
    Last Post: 01-23-2007, 07:00 PM
  3. Visual Studio 6.0 Help
    By L_I_Programmer in forum C++ Programming
    Replies: 1
    Last Post: 03-24-2003, 10:35 PM
  4. ListView Version 6.0 and ImageLists
    By blundstrom in forum Windows Programming
    Replies: 0
    Last Post: 07-26-2002, 09:35 AM
  5. interrupt handler functions in Visual C++ 6.0
    By scromer in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 01-07-2002, 07:06 PM