Classes, Example
- A rational number class
- Store numbers as ratios, (or fractions)
- Exercise 3, page 659
- Properties:
- Domain
- A ratio of two signed integers
- Limited by the representation of integers
- Operations
- Constructors
- Initialize to 0
- Initialize to a given value
- Observers
- Output
- Numerator
- Denominator
- Value (return the floating point equivelent)
- Compare
- Add
- Subtract
- Multiply
- Divide
- Transformers
- Iterators
- Some files to start from