Purchase Solution

Building Classes

Not what you're looking for?

Ask Custom Question

The point-slope equation of a line having slope m and pasing through pint P with coordinates (x1, y1) is y-y1=m(x-x1).

a. Write a class for a CartesianPoint, described by its x- and y- coordinates, with all appropriate operations on such objects.

b. Write a LineSegment class, described by two CartesianPoint endpoints. In addition to the usual operations, this class should provide operations to compute:
-the midpoint of the line segment joining two points and
-the equation of the perpendicular bisector of this line segment.

c. Write a class for Line, described by its slope and a point on the line, with opeations that find the point-slope equation of the line and find the slope-intercept of the line.

d. Write a program to read the point and slope information for two lines and to determine whether they intersect or are parallel. If they intersect, find the point of intersection and also determine whether they are perpendicular.

**NOTE: Request to have the problem resolved in C++

Purchase this Solution

Solution Summary

Building Classes overview

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Basic Networking Questions

This quiz consists of some basic networking questions.