Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3:36 PM HW03-Lin.pdf Create a project called hw3 and a source file called hw3.cpp. The type Point is a fairly simple data type. Write a

image text in transcribed
3:36 PM HW03-Lin.pdf Create a project called hw3 and a source file called hw3.cpp. The type Point is a fairly simple data type. Write a definition of a class named Point that might be used to store and manipulate the location of a point in the plane. You will need to declare and implement the following member functions A member function that sets the private data after an object of this class is created A member function to move the point by an amount along the vertical and horizontal directions specified by the first and second arguments, e.g., the current coordinate is (3,4) and moved by (1,1), that is, one up, one right. A member function to rotate the point by 90 degrees clockwise around the origin. Two accessor functions to retrieve the current coordinates of the point. Document these functions with appropriate comments. Embed your class in a test program (driver) that requests data for several points from the user, creates the points, and then exercises the member functions. Your driver should test all functions above, but leave the code to test the follow cases (1) We start with (1,2). This point is rotated 90 degrees, four times, getting back to the original point. (2) The point (3,4) is set and moved by (1,1), that is, one up, one right. (3) A second point, (5,-4) is set and moved by (-5,4) 5 left, 4 up. Then we move it back to the origin, Rubric: . Please read GradingRubricGuidline.pdf on Blackboard 80% for the correctness of the code 20% for the documentation and the programming style, including but not limited to the following rules below . Each function must be commented with a description of what it does, the role of its parameters and the meaning of its return value. olndentation level of your code must correspond to the nesting level

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions

Question

How long has artificial intelligence been in existence

Answered: 1 week ago