Define a class Car to represent an automobile in a driving simulation program. You are required to include the following components:
The class tank includes the following components:
Include default constructors and constructors for all classes.
Overload << and >> for all three new classes, ensuring that the definitions of << and >> for Car use the definitions of << and >> for Date and Tank.
Define a member function called fillUp for class Tank
Define a member function called drive for class Car.
Function fillUp should copy the tank capacity value into the current fuel level component and return a type double value indicating the number of litres re- quired to fill the tank.
Function drive should take the number of kilometres driven as an input argument and should adjust the odometer reading and the tank's current fuel level component.
Write a driver function that fills several Car-class variables in ways designed to test the three classes' various constructor functions and the overloaded >> and << operators. Also include calls to fillUp and drive.
Store class interface and implementation in separate files.
A rational number is a number that can be represented as the quotient of two integers. For example, 1/2, 3/4, 5/3 etc. (“/” indicates the normal notation for a fraction not the integer division used in a C++ program.)
Write a rational number class with the following properties:
The following formulas will be useful in defining the class functions: See image.
Store the Rational class interface and implementation in separate files.
Write a test program to test your class.
Your are required to provide: