Access over 20 million homework & study documents

ABC Corp recently released a new version of their Web based inventor

Content type
User Generated
Rating
Showing Page:
1/3
ABC Corp recently released a new version of their Web-
based inventory management software. Unfortunately a
bug in their code was discovered that would allow an
attacker to take full control of the host Web server. In
information security this is considered to be a(n)
Solution
(C++) Write a class called Point that contains two doubles
that represent its x- and y-coordinates. It should have get
and set methods for both fields. It should have a
constructor that takes two double parameters and passes
those values to the set methods to initialize its fields. It
should have a default constructor that initializes both
coordinates to 0 (also using the set methods). It should
also contain a method called distanceTo that takes as a
parameter a constant reference to another Point and
returns the distance from the Point that was passed as a
parameter to the Point that we called the method of. You
will need to use sqrt(). For example at the end of the
following, dist should be equal to 5.0:
Next, write a class called LineSegment that contains two
Points that represent its two endpoints. It should have get

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/3
and set methods for both fields and a constructor that
takes two Point parameters and passes them to the set
methods to initialize the data members. It should also
contain a method called length that returns the length of
the LineSegment by using the distanceTo method on its
endpoints and a method called slope that returns the
slope of the LineSegment. You don\'t need to do anything
special for vertical lines - division by zero will result in the
special value inf, which stands for \"infinity\". Your program
will not be tested with line segments where both endpoints
have the same coordinates. The LineSegement class might
be used as follows:
Do not include a main method in the files you submit - just
the definition of your Point and LineSegment classes. I will
be including a main method for testing, and there can only
be one main method in a program. You will of course need
to have a main method for testing purposes - just make
sure you delete it or comment it out before submitting your
files.
The functions for the Point class should have the following
names:
setXCoord, getXCoord
setYCoord, getYCoord
distanceTo
The functions for the LineSegment class should have the

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/3

Sign up to view the full document!

lock_open Sign Up
Unformatted Attachment Preview
ABC Corp recently released a new version of their Web based inventory management software. Unfortunately a bug in their code was discovered that would allow an attacker to take full control of the host Web server. In information security this is considered to be a(n) Solution (C++) Write a class called Point that contains two doubles that represent its x- and y-coordinates. It should have get and set methods for both fields. It should have a constructor that takes two double parameters and pa sses those values to the set methods to initialize its fields. It should have a default constructor that initializes both coordinates to 0 (also using the set methods). It should also contain a method called distanceTo that takes as a parameter a constant reference to another Point and returns the distance from the Point that was passed as a parameter to the Point that we called the method of. You ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Anonymous
Just what I needed. Studypool is a lifesaver!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4