CIS 22B - Notes for Mon Nov 20

Announcements and Reminders

Review exercise 15

More Class Concepts

CIS27 Notes

Examples (zip file)

The this pointer

Static Data Members

Static Member Functions

Friends

Lab Exercise #9

Put your name, the compiler used, and Lab Exercise #9 in a comment at the top of your program. Email your source code. This lab exercise is due at the beginning of the next lecture.  You may email your lab solution prior to that.  

Complete the following program:

class Circle
{
    static float pi;
    float radius;
public:
    Circle(float = 1.0);
    static void changePi(float);
    friend float circumference(const Circle&);
};

???

int main()
{
    Circle c(5.0);
    cout << circumference(c) << endl;
    Circle::changePi(3.1416);
    cout << circumference(c) << endl;
}

******  Program Output  ******

31.4
31.416