Computer Science Homework Solutions
Problem
#130872

Visual C++

The following class uses composition to define a line object in terms of two point objects.

class line
{
public:
Point startingpoint();
point endingpoint();
float length();
line (int startX, int startY, int endX, int endY);

private:
point startPoint;
point endPoint:

};

1) write a fucntin defintion for the Line class constructor
2) for the line class implement the StartingPoint() and EndingPoint() member functions
3) for the line class implement the lenght() member function. the distance between two points (x1,y1) and (x2,y2) is sqrt ((x1,x2)2 + (x2,y2)2)

Solution
What is this?
By OTA - Overall OTA Rating
Yupei Xiong, PhD - 4.8/5
Purchase Cost Now
$2.19 CAD (was ~$7.98)
Included in Download
  • Plain text response
  • Attached file(s):
    • 130872.cpp
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • The definition of a constructor. - What is a constructor?
  • Write a constructor - Can someone write a constructor method for the class "Dog" that uses the "this reference" and explain what it does?
  • Stuck on coding Java IOExceptions - My problem is an exception class called ChatIOException that extends from IOException that is imported from the java.io package in order to extend IOException. Also, the ChatIOException class is with ...
  • Java Programming - I'll give a start; this is the class definition; it has one member variable, one constructor method, and another public method: public class Car { private int no_doors; public Car(in ...
  • Commenting on the enclosed Java Code - I need assistance in commenting on the enclosed code, consider things like code layout, use of variable names, general readability and understandability. The enclosed program suppose to Implement ...
Browse