ww bocny Backboard Colors Uta-2020 Seri l OUSMANE FALL Batabe To upload: 1. Define a class Point whose objects are points in the plane with integer x and y coordinates ranging from 0 to 40. It has a...


ww bocny Backboard Colors Uta-2020 Seri l OUSMANE FALL Batabe To upload: 1. Define a class Point whose objects are points in the plane with integer x and y coordinates ranging from 0 to 40. It has a function that draws them in the screen output using the character . Its data members are the x-coordinate int xCoor and the y-coordinate int yCoor. Its function members are: • The constructor. Should check that the coordinates are within the limits given above; if not, it should default to the point (0,0) and print a message "Invalid input. Defaulting to (0,0).". • void setPoint(int x, int y) that sets xCoor and yCoor to x and y. It should check for validity and default as in the constructor. • int getXcoor() and int getYcoor() that returns the x and y coordinates of the point. • void plotPoint that prints out the point in the terminal using "*". You do not have to print the axes (as below), but it is not hard and you will ge extra credit for it! HINT FOR FUNCTION plotPoint() (read after you have thought about how to it and only if you do not know what to do). The pseudocode would be like this: Write two nested for loops: for j from 40 to 0 (y coordinate going down) for i from 0 to 40 (x coordinate going right) if i and j are equal to the x and y coordinates of the point, cout ***; else cout" ". Then cout an endl after the end of the inner loop. For example, the output for the point (4,12) could be: wo 1000 MacBook Pro




May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here