Dog Class Reference

#include <dog.h>

Inheritance diagram for Dog:

Pet

List of all members.

Public Member Functions

 Dog ()
 Dog (string name, double age) throw ( out_of_range )
double getDogYears () const
virtual void print (ostream &out=cout) const
virtual void read (istream &in) throw ( out_of_range )


Detailed Description

Dog class for storing information about dogs. Derived from Pet, which has a name and age.

Author:
Mark Maloof
Version:
1.1, 7/21/10

Constructor & Destructor Documentation

Dog::Dog (  ) 

Default constructor.

Dog::Dog ( string  name,
double  age 
) throw ( out_of_range )

Explicit class constructor that initializes this pet object with the arguments name and age.

Parameters:
name a string storing the name of this pet
age a double storing the age of this pet
Exceptions:
out_of_range if the age is out of range


Member Function Documentation

double Dog::getDogYears (  )  const

Returns this dog's age in so-called dog years, using the rule of thumb that seven dog years equals one human year.

Returns:
age in dog years, a double

void Dog::print ( ostream &  out = cout  )  const [virtual]

Prints this pet's width to the ostream out, which defaults to cout.

Parameters:
out an ostream for printing (defaults to cout)

Reimplemented from Pet.

void Dog::read ( istream &  in  )  throw ( out_of_range ) [virtual]

Reads this pet's characteristics from the ifstream argument, storing them in the respective data members.

Parameters:
in an istream for reading
Exceptions:
out_of_range if the age is out of range

Reimplemented from Pet.


The documentation for this class was generated from the following files:

Generated on Thu Jul 29 11:29:32 2010 by  doxygen 1.5.5