Write a program that uses a structure called point to model


Program

A point on the two dimensional plane can be represented by two numbers: an X coordinate and a Y coordinate. Foe example (4,5) represents a point to the right of the origin along with the X axis and 5 units up the Y-axis. The sum of two points can be defined as a new point whose X coordinate is the sum of the X coordinates of the points and whose Y coordinate is the sum of their Y coordinates.

Write a program that uses a structure called point to model a point. Define three points and have the user input values to two of them. Than set the third point equal to the sum of the other two and display the value of the new point. Interaction with the program might look like this:

Enter coordinates for p1: 3  4
Enter coordinates for p2: 5  7
Coordinates of p1+p2 are:8,11

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a program that uses a structure called point to model
Reference No:- TGS01474481

Now Priced at $10 (50% Discount)

Recommended (99%)

Rated (4.3/5)