Question: In C++ write a class called Point that contains two private-member variables for x and y coordinates of type double. Write a default constructor that

 In C++ write a class called Point that contains two private-member

In C++ write a class called Point that contains two private-member variables for x and y coordinates of type double. Write a default constructor that initializes the member variables to 0. Define the default constructor with an initialization section. Write a custom constructor with two parameters that initializes each member variable with its corresponding parameter. Define the custom constructor with an initialization section. Overload the > operator for Point (as a non-member friend function). The overloaded >> operator returns an istream object. The prototype of the overloaded operator >> is friend istream& operator >> (istream& input, constPoint& p.: In your main(), declare two Point objects that are initialized by the default constructor. Prompt user inputs as shown in the test case and save the user inputs with your overloaded >> operator. And display the x and y coordinates of the user inputs with your overloaded

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!