Search:

Type: Posts; User: Elysia

Search: Search took 0.19 seconds.

  1. Replies
    24
    Views
    8,724

    Mmm, now would be an excellent time to try out...

    Mmm, now would be an excellent time to try out the debugger.
    See if you can spot the error. Will do you good practice.
  2. Replies
    24
    Views
    8,724

    By calling appropriate member functions on the...

    By calling appropriate member functions on the objects! You know the Rectangle is supposed to work, right?
  3. Replies
    24
    Views
    8,724

    That is normal output. Nothing wrong there. You...

    That is normal output. Nothing wrong there.
    You should be looking at the black console window that pops up.



    What does redefine mean in this context?
  4. Replies
    24
    Views
    8,724

    When I ran your corrected example, I got The...

    When I ran your corrected example, I got

    The length entered is invalid and has been set to 1.00The width entered is inval
    id and has been set to 1.00Length: 1Width: 1Area: 1Perimeter: 4Length:...
  5. Replies
    24
    Views
    8,724

    Don't worry about it. I did not put much thought...

    Don't worry about it. I did not put much thought into that code.
    It was a simple example, not one meant to be correct in any way (for example, why should the result be a double if both parameters...
  6. Replies
    24
    Views
    8,724

    The only problems I find are cout

    The only problems I find are

    cout<< "Area: " << area;
    cout<< "Perimeter: " << perimeter;

    You don't have member variables or local variables named area and perimeter. Presumably you...
  7. Replies
    24
    Views
    8,724

    #include class Rectangle {...

    #include <iostream>

    class Rectangle
    {
    public:
    Rectangle(double area, double length);
    double CalcPerimeter() const;
    private:
    double m_length, m_area;
    };
  8. Replies
    24
    Views
    8,724

    You told the compiler that the printData function...

    You told the compiler that the printData function was global in your .cpp file:

    void printData()

    should be

    void Rectangle::printData()

    As for the calc functions, you forgot to add...
  9. Replies
    24
    Views
    8,724

    If, in your class definition (as it's called;...

    If, in your class definition (as it's called; weird, I know), you have:

    Rectangle (double length);

    Then, in your accompanying .cpp file, you must have (note that the type is there)
    ...
Results 1 to 9 of 9