2 class lineType | Instructions 3 { 4 public: The equation of a line in standard form is ax void setline(double a - 0, double b - 0, double c - e); + by = c, wherein //Function to set the line. both a and b 8 void equation() const; cannot be zero, and 9 a, b, and c are real numbers. If b=0, 10 double getXCoefficient() const; double getYCoefficient() const; double getcOnstantTerm() const; 11 then -a/b is the slope 12 13 of the line. If a = 0, void setXCoefficient(double coeff); void setYCoefficient(double coeff); 14 then it is a horizontal 15 line, and if b = 0, then 16 void setConstantTerm(double c); it is a vertical line. The slope of a vertical line is undefined. Two 17 18 double slope() const; 19 //Return the slope. This function does not check if the lines are parallel if they have the same slope or both are 20 //line is vartical. Because the slope of a vertical line 21 //is undefined, before calling this function vertical lines. Two check if the lines are 22 //line is nonvertial. 23 perpendicular if 24 bool verticalLine() const; either one of the lines 25 bool horizontalline() const; is horizontal and the 26 other is vertical or the bool equallines(lineType otherLine) const; 27 product of their slopes is -1. Design 28 //Returns true of both lines are the same. 29 the class lineType 30 bool parallel(lineType otherLine) const; 31 //Function to determine if this line is parallel to store a line. To to otherLine. store a line, you need 32 to store the values of 33 bool perpendicular(lineType otherLine) const; a (coefficient of x), //Function to determine if this line is 34 perperdicular to otherLine. b (coefficient of y), and c. Your class 35 void pointofIntersection(lineType otherLine); //If lines intersect, then this function finds the point 36 must contain the 37 following operations: 38 //of intersection. • If a line is 39 40 lineType (double a - 0, double b = 0, double c - 0); nonvertical, then 41 //Constructor determine its 42 slope. 43 private: 44 double xCoeff; • Determine if two double yCoeff; 45 lines are equal. 46 double constTerm; 47 bool hasslope; (Two lines a,x + 48 }; b,y = c, and a,x + 49 bay = C2 are equal if either a, = a, b, = b2, and c, = C2, or a, = kaz, b, = kb, and c, = kc2, and for some real number k .) Determine if two lines are parallel. • Determine if two lines are perpendicular.
2 class lineType | Instructions 3 { 4 public: The equation of a line in standard form is ax void setline(double a - 0, double b - 0, double c - e); + by = c, wherein //Function to set the line. both a and b 8 void equation() const; cannot be zero, and 9 a, b, and c are real numbers. If b=0, 10 double getXCoefficient() const; double getYCoefficient() const; double getcOnstantTerm() const; 11 then -a/b is the slope 12 13 of the line. If a = 0, void setXCoefficient(double coeff); void setYCoefficient(double coeff); 14 then it is a horizontal 15 line, and if b = 0, then 16 void setConstantTerm(double c); it is a vertical line. The slope of a vertical line is undefined. Two 17 18 double slope() const; 19 //Return the slope. This function does not check if the lines are parallel if they have the same slope or both are 20 //line is vartical. Because the slope of a vertical line 21 //is undefined, before calling this function vertical lines. Two check if the lines are 22 //line is nonvertial. 23 perpendicular if 24 bool verticalLine() const; either one of the lines 25 bool horizontalline() const; is horizontal and the 26 other is vertical or the bool equallines(lineType otherLine) const; 27 product of their slopes is -1. Design 28 //Returns true of both lines are the same. 29 the class lineType 30 bool parallel(lineType otherLine) const; 31 //Function to determine if this line is parallel to store a line. To to otherLine. store a line, you need 32 to store the values of 33 bool perpendicular(lineType otherLine) const; a (coefficient of x), //Function to determine if this line is 34 perperdicular to otherLine. b (coefficient of y), and c. Your class 35 void pointofIntersection(lineType otherLine); //If lines intersect, then this function finds the point 36 must contain the 37 following operations: 38 //of intersection. • If a line is 39 40 lineType (double a - 0, double b = 0, double c - 0); nonvertical, then 41 //Constructor determine its 42 slope. 43 private: 44 double xCoeff; • Determine if two double yCoeff; 45 lines are equal. 46 double constTerm; 47 bool hasslope; (Two lines a,x + 48 }; b,y = c, and a,x + 49 bay = C2 are equal if either a, = a, b, = b2, and c, = C2, or a, = kaz, b, = kb, and c, = kc2, and for some real number k .) Determine if two lines are parallel. • Determine if two lines are perpendicular.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education