This preview shows page 1. Sign up to view the full content.
Unformatted text preview: necessary. Also make any adjustments needed for the country to have access to state information. 5) Add functions to the driver program to allow user input data for a state, and edit the information for an existing state. (use pass by reference) Exercise 1. Create a line segment class that is composed of two objects of a point class 2. The point class has two private attributes for an x-coordinate value and a y coordinate value. (Create appropriate setters and getters for the attributes) 3. Use the two point objects to compute the length of the line segment using the distance formula: ( distance = a square of ( ( X 2 X 1 ) 2 + (Y 2 - Y 1 ) 2 ) 4. Demonstrate these methods on at least two line segment objects. 5. Create a sum function and average function that is called in your main to compute the sum and average of the lengths of your line segment objects...
View Full Document
- Spring '07
- Computer Programming