Due date: Nov 12 before class
Techniques: Operator overloading and multiple inheritance
(1) Implement a class Fraction.
A fraction is a number of the form 3/4 or 6/23 or ...
Overload the arithmetic operators + - to handle this class fractions. Also overload the input/output operators >> and <<
So something like cout << fr should output the value of the fraction and NOT the address of the object.
NOTE: Please take into account that 4/4 = 1. So the numerator is 1 and the denominator is 1. In such a case, do not output 1/1 but only 1.
Also if you wish, you may print the float value. So 3/4 is 0.75.
(2) Now a small assignment with multiple inheritance.
Consider the four classes
Now relate these four classes using multiple inheritance.
Also all the classes must have one function called draw().
You may use virtual functions as well as virtual inheritance for this assignment. No user interaction is necessary. Please use constructors and call the base constructors from the derived.
The purpose of this assignment is to get you familiar with multiple inheritance so you can pass the border co-ordinates in the Window_with_borders constructors or something as easy.