subject

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, (0,0).

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:30
Me2540 week 5 assignment what do i want to know?
Answers: 1
question
Computers and Technology, 23.06.2019 01:50
Write a program that uses a random number generator to generate a two digit positive integer and allows the user to perform one or more of the following operations: a. double the number. b. reverse the digits of the number. c. raise the number to the power of 2, 3, or 4. d. sum the digits of the number. e. if the number is a two-digit number, then raise the first digit to the power of the second digit. f. if the number is a three-digit number and the last digit is less than or equal to 4, then raise the first two digits to the power of the last digit. after performing an operation if the number is less than 10, add 10 to the number. also, after each operation determine if the number is prime. each successive operation should be performed on the number generated by the last operation. your program should not contain any global variables and each of these operations must be implemented by a separate function. also, your program should be menu driven. 7. (fraction calculator) write a program that
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
What are "open-loop" and "closed-loop" systems
Answers: 1
question
Computers and Technology, 24.06.2019 11:20
Every telecommunication setup uses two devices: one device to transmit data and one device to receive data. which device transmits frequencies to mobile phones? towers transmit frequencies to mobile phones.
Answers: 1
You know the right answer?
Create a project called hw3 and a source file called hw3.cpp. the type point is a fairly simple data...
Questions
question
Mathematics, 10.10.2019 20:00
Questions on the website: 13722367