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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!