CIS 11: Data Structures and Algorithms
Project A
Complete Project 5 from Chapter 2 of the text. Directions are on page 90.
- Name your class point3D. You will submit its definition in point3D.h and the implementation in point3D.cpp.
- Include member functions whose prototypes are:
point3D(double x = 0, double y = 0, double z = 0);
void get(double& x, double& y, double& z) const;
void set(double x, double y, double z);
void shift(double xDistance, double yDistance, double zDistance);
void rotate(double xDegrees, double yDegrees, double zDegrees);
- Use assert() to insure that at least two arguments to rotate() are zero. Notice that the parameter names suggest that the units for the arguments are degrees. Be sure to test accordingly.
- Create a namespace for your class: cis11.
- Be sure to include appropriate documentation including
-
- value semantics,
- description of functionality,
- precondition(s) and
- postcondition(s).
- Test your class thoroughly with your own client code.
When you're satisfied with the definition and implementation, submit your work via the CATE form for Project A.
Legend: method/function keyword literal
2007/02/23