Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Construct 2 classes named Rec_coord and Pol_coord. Rec_coord should have 2 doubl

ID: 3624662 • Letter: C

Question

Construct 2 classes named Rec_coord and Pol_coord. Rec_coord should have 2 double precision numbers xval and yval that store point's x and y values in rectangular coordinates. The member function should have a constructor, a display function and a friend function named conv_pol(). The Pol_coord class should have 2 double numbers dist and theta to store distance and angle in polar coordinates. It should also have a constructor, a display function and a friend function named conv_pol().

The friend function should accept an integer named dir, two doubles named val1 and val2 and two references recref and polref. Recref is a reference to Rec_coord and polref is a reference to Pol_coord. If value of dir is 1 then val1 and val2 should be considered x and y coordinates that is to be converted to polar. If the value of dir is any other value then val1 and val2 are distance and theta to be converted to rectangular.
the formulas for rec to polar
r=x2+y2

=arctan(y/x)

for polar to rec

x=rcos and y =rsin

Explanation / Answer

i hope one can answer it please..