Question: Construct a class named Coord containing two double-precision data members named xval and yval, used to store a points x and y values in Cartesian
Construct a class named Coord containing two double-precision data members named xval and yval, used to store a points x and y values in Cartesian coordinates. The member methods should include constructor and display methods and a method named convToCartesian(). The convToCartesian() method should accept two double-precision numbers named r and theta representing a point in polar coordinates and convert them into Cartesian coordinates. For conversion from polar to Cartesian coordinates, use these formulas in a working C++ program:
x = r cos (theta)
y = r sin (theta)
Design:
Code:
Output:
its C++
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
