Starting from:

$30

Homework # 7 Solution

Read the Wikipedia page about the main number types at https://en.wikipedia.org/wiki/List_of_types_of_numbers#Main_types




You will make a class hierarcy of number types NaturalNumber, Integer, RationalNumber, RealNumber, IrrationalNumber, ImaginaryNumber, and

ComplexNumber




Make a class hierarchy of several levels such as below. Include a separate hierarchy document (such as below) that shows your classes and their members (function and data).







Number










B C















F




D


E




G

















Each class should have appropriate constructors, and setters, getters. Each class should also overload operator+, operator-, operator <, and operator<< .




Use separation of interface and implementation with your namespace.




Write the driver code for your classes for testing.

More products