In the previous chapter, we looked at UML class diagrams. This chapter continues the study of the static view of software by looking at typical patterns found in class diagrams. These patterns recur in many designs; by learning and using them you are reusing the collective experience of many software developers.
CSC241: Object Oriented Programming Lecture No 04 Previous Lecture • Constructor – example program • Placing class in separate file • Destructor – example program • Constructor with arguments – example program Today’s Lecture • Overloaded function – • Constructor const (constant) – object – member function – data member – object as function argument • friend function • this pointer Objects as Function Arguments class Distance { //Distance class private: int feet; float inches; public: Distance() : feet(0), inches(0.0) {} Distance(int ft, float in) : feet(ft), inches(in) {} void getdist(){ cout > feet; cout > inches; } void showdist(){ cout