text cover

Data Abstraction and Problem Solving with C++

Walls and Mirrors

by Frank M. Carrano

Addison Wesley Logo

Ball Class Reference

#include <Ball406.h>

Inheritance diagram for Ball:

Inheritance graph
[legend]
List of all members.

Detailed Description

Definition at line 15 of file Ball406.h.

Public Member Functions

 Ball ()
 Ball (double initialRadius, const string &initialName)
void getName (string &currentName) const
void setName (const string &newName)
void resetBall (double newRadius, const string &newName)
virtual double getArea () const

Private Attributes

string theName


Constructor & Destructor Documentation

Ball::Ball  ) 
 

Definition at line 6 of file Ball406.cpp.

References setName().

Ball::Ball double  initialRadius,
const string &  initialName
 

Creates a ball with radius initialRadius and name initialName.


Member Function Documentation

void Ball::getName string &  currentName  )  const
 

Determines the name of a ball.

void Ball::setName const string &  newName  ) 
 

Sets (alters) the name of an existing ball.

Referenced by Ball().

void Ball::resetBall double  newRadius,
const string &  newName
 

Sets (alters) the radius and name of an existing ball to newRadius and newName, respectively.

double Ball::getArea  )  const [virtual]
 

cross-sectional area

Reimplemented from Sphere.

Definition at line 35 of file Ball406.cpp.

References Sphere::getRadius().


Member Data Documentation

string Ball::theName [private]
 

the ball's name

Definition at line 49 of file Ball406.h.


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

Generated on Sun Aug 27 20:00:05 2006 for AWLogo by  doxygen 1.4.6