| Object Oriented Programming and Design with C++ | Dr. Aaron Naiman |
| Course #15001301 | <naiman@math.jct.ac.il> |
| Spring, 2006 | Office hours: Monday, 13:30-14:30 |
Define an angle class, comprised of degrees, minutes
(1/60 degree) and seconds (1/60 minute). The first two should be
ints, and the last, a float (or
double). Take care that the degrees is always stored
between 0° and 360° (non-inclusive), and the minutes and
seconds between 0 and 60 (non-inclusive).
Define also the following member functions:
angle in radians
angle as an argument, and calculates and returns the
angle in radians. Use the same function names for the
global and member functions.
Note: have the corresponding view and modify functions use the same
names, taking advantage of overloading. E.g., a consistent naming
scheme might be _foo for the data member, and
foo() for the corresponding view and modify member
functions.
Define main() to invoke all of the functions defined,
with all possible forms (i.e., possibilities of default values). Be
creative. Note that main() will be in a separate file.
(How many files does that make it so far?)
You may want to use a small I/O library you have tucked away somewhere, to assist with the user input. ("Hmm, what does he mean?")