Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment Lines Write a modular program, spFunetionsHlines.cpp, with functions to perform the folowing: bool areParallel (parameter list as described) This function will return true if

image text in transcribed
Assignment Lines Write a modular program, spFunetionsHlines.cpp, with functions to perform the folowing: bool areParallel (parameter list as described) This function will return true if two lines, each line defined by two points, are parallel; otherwise, it wll return false. bool arePerpendicular (parameter list as described) This function will return true if two lines, each line defined by two points, are perpendicular, otherwise, it will return false. double calculateDistance (parameter list as described) This function will calculate and return the distance between two points. bool calculateIntersection (parameter list as described) This function will return true if two lines, each line defined by two points, intersect; otherwise, it will return false. If the two lines intersect, the point at which they intersect should be passed back to the calling function via reference parameters. void calculateMidpoint (parameter list as described) This function should calculate the midpoint of a line segment detined by two points. Since the midpoint consists of two values, these values should be passed back to the calling function via reference parameters. bool calculateSlope (parameter list as described) This function will return true if the slope of a line, defined by two points, is defined; otherwise, it will return false. If the slope is defined, the slope should be passed back to the calling function via a reference parameter. void displayEquation (parameter list as deseribed) This function will display the equation of a line, defined by two points, to the screen in the standard format, y the slope and b is the y-intercept. mx b, where m is void getPoint (paraneter list as deseribed) This function should get a point, (x, y), from the user and pass the values for both x and y back to the calling function using reference parameters. bool isonLine (paraneter list as deseribed) This function will determine if a point, (x, y), is on a line defined by two other points. If the point is on the line, the function should return true, otherwise, it should return false. bool isVertical (parameter list as described) This function should return true if a line, defined by two points, is vertical, otherwise, it should return false. The points could contain decimal values which means the variables storing these values should be of type double. Recall that floating- point numbers should not be compared using the == relational operator, instead, use an epsilon comparison with a tolerance of 0.0000001 When establishing parameter lists which include multiple points, students often implement an ordering of all the x values together followec by all of the y values, e.g. x1, x2, yl, y2. A better ordering would be to group the x and y values of a point together, e.g. x1, yl, x2. y2 Be sure to include driver code in function main to test these functions thoroughly. Recall that testing functions using driver code calls for the use of hard-coded values rather than prompted values; that will work for all of these functions except getPoint) which requires use input values for testing. The file containing this program should be named spFunctionsHWlinescpp

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions

Question

How effective have these groups been in the past?

Answered: 1 week ago

Question

7. What is coaching? Is there only one type of coaching? Explain.

Answered: 1 week ago