Saint Marys
University
Department of Mathematics and Computing Science
CSC 341.1: Data Structures and Software Engineering I
FALL 1999-2000
Assignment #1
Instructor: Dr. Pawan
Lingras
Due Date: September 23,1999 (11:30 p.m.)
Create a class called Polar that has two data members called r and theta.
- Write a constructor, which accepts the values of r, and theta, use
default values of zero. Overload input, output, assignment, comparison (== and !=). Note
that the value of theta should be reduced based on the knowledge that
theta == 2*pi + theta in the implementation of these
operations.
- Write a member function called reduce() that reduces the value of theta
to its smallest possible value
- The member function also throws an exception (Note: it is not an error) called NotReducible
if the value of theta cannot be reduced.
Write a test program to test all of the features of Polar.