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

Define a class called Point. It has two type; and three public member functions

ID: 3554319 • Letter: D

Question

Define a class called Point. It has two type; and three public member functions a constructor, setf'omtftni printPointO- I'hc constructor initialize the data members to 0. selPoint function sets the values for data members. You need to use the operator '?*. to test whether x and y are positive. If not, assign them to 0. l'he function print Point prints the message "(X, Y)" where X and Y are two integers. the main program, first input the number of points from the keyboard, vise new operate to dynamically declare an array of objects whose ements are the same as the input number. Use for loop to prompt the user to enter two integers each time. Finally, print at points the user entered. I he possible output is Enter the number of points: 3 Enter two integers: 3ft Enter two integers: 2 -2 Enter two integers: 0 5 The points you entered are: Point 1: (3# 2) Point 2: (2, 0) Point 3: (0, 5)

Explanation / Answer

#include #include using namespace std; class Point { int x,y; public: Point() { x=0; y=0; } void SetPoint(int a, int b) { (a
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote