7.1

Crate a class FLOAT that contains one float data member. Overload all the four arithmetic operators so that they operate on the objects of FLOAT.

## OUTPUT

F1 = 2.5
F2 = 3.1
F1+F2 = 5.6
F1-F2 = -0.6
F1*F2 = 7.75
F1/F2= 0.806452

7.2

Design a class Polar which describes a point in the plane using polar coordinates radius and angle. A point in polar coordinates is shown below figure 7.3
Note that we cannot add polar values of two points directly. This requires first the conversion of points into rectangular coordinates, then adding the respective rectangular coordinates and finally converting the result back into polar coordinates. You need to use the following trigonometric formula:
x = r * cos(a);

y = r * sin(a);
a = atan(y/x); //arc tangent
r = sqrt(x*x + y*y);

## OUTPUT

Enter radius and angle : 10 45
P1:
angle = 44.999998
P2 :
angle = 44.999998
P3 :
angle = 44.999998

7.3

Create a class MAT of size m * n. Define all possible matrix operations for MAT type objects.

## OUTPUT

Enter first matrix size : 2  2

m1 =

1     2

3     4

Enter second matrix size : 2    2

m2 =

5     6

7     8

m1 =

1     2

3     4

m2 =

5     6

7     8

m1+m2:

6       8

10     12

m1-m2:

-4       -4

-4      -4

m1 x m2:

19      22

43     50

7.4

Define a class String. Use overload == operator to compare two strings.

## OUTPUT

Enter 1st string : our sweetest songs tel our saddest thought
enter 2nd string : a burning desire lead to success.
Two string are not equal

7.5

Define two classes Polar and Rectangle to represent points in the polar and rectangle systems. Use conversion routines to convert from one system to the other.