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 xcoordinate 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
This note was uploaded on 04/06/2009 for the course CSCI 101L taught by Professor Ghyam during the Spring '07 term at USC.
 Spring '07
 Ghyam
 Computer Programming

Click to edit the document details