You are on page 1of 2

// The following two lines are meant only to keep the

following code to be
// duplicated. This way, multiple files can include
"NumberChanger.h" without breaking.
// The "NUMBERCHANGER_H_" variable is only meant to be
unique to the file. It could be
// anything and still be valid. IE it could be BOB_H_, or
jim, or apiwheoit. and still work
class NumberChanger // This is the name of the object,
it will be used much like an int or char.
public: // This means that data members are accessible
outside of the class. Generally,
// only functions and constant should be in
this section
NumberChanger(double aIn, double bIn); // This is a
prototype for the NumberChanger

// Constructor function. This function is used to

// setup the object.
double getA(); // This is a function prototype, it is
not defined here
double getB(); // These functions will later return
the values of a and b
double mulA(double val); // This function will
multiply A by val and return the value
double mulB(double val);
private: // This section is the one that is only
accessible by member functions of the
// class, and friend functions. It is
meant to "protect" things from manipulation
// outside of the class (or at least
tell programmers "Hey, don't touch")
double a; // These two variables will hold the values
of a and b for the object.
double b; // They are unique for each object created