Homework 3: C++ programming Due date: July 29th, at the same time as the exam Turn in the hard copy of the listing. 1. Implement problem 4 from homework 2 using object oriented programming. The Position structure needs to be a class, and the printPosition and move functions member functions of the class. 2. Implement a class which implements Rational numbers. You need to store the numerators and denominators as integers. Implement the following operations as functions. It is part of your job to design the signature of functions: a) Printing in the "a/b" form b) Printing in the "a b/c" form, where b/c < 1 (canonical form, eg. 1 1/2) c) Multiplying two rational numbers. d) Dividing two rational numbers. e) Adding two rational numbers. f) Adding an "int" to a rational number. g) Adding a "float" to a rational number. h) Simplifying a rational number (eg. 2/4 ---> 1/2) 3. Write an inheritance hierarchy for class Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square. Use Quadrilateral as the base class of the hierarchy. Make the hierarchy as deep (i.e. as many levels as possible). The private data of Quadrilateral should be the x-y coordinate pairs for the four endpoints of the Quadrilateral. 4.a) Consider the function middle(a,b,c) which returns the parameter which is the middle one when they are ordered. For example, if a < b < c, then middle(a,b,c) returns b. Implement this function as a template function and try it out for integer and float values. b) Will this function work for character strings? If not, what do you need to do make it work? (Hint: read the chapter 8 from the book).