{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

L15 - OO Design - Object Oriented Design Where do we stand...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Object Oriented Design Where do we stand now? Class is a “blueprint” for objects – an ADT Class Definition – placed in header file – Indicates its name along with: Its data members or instance variables (declarations of these) Its methods (prototypes for these) Indication as to the accessibility of each member element (public, private, protected) – This defines the interfaces – Usually does not contain any code for implementation of the methods Definition of methods – Placed in a source file (that is, a .cpp file) – Syntax is <classname>::<methodname> ( <args>){…..};
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
// header file for the weather class in weather.h #pragma once // tells the compiler to process this header only once #include <iostream> using namespace System; using namespace std; class weather { public: weather(); // constructor void setTemps (int, int); // method to set the temperatures double avgTemp (); double degreeDays (); void printData (); // prints out the data members private: int maxtemp; int mintemp; // must be <= maxtemp };
Background image of page 2