By implementing the concepts of Classes and Objects, write a C++ program that determines the slope of a line from the coordinates, P(x,y), of the 2 points. The coordinates of the 2 points: P1 (x1, y1) and P2(x2, y2) are to be entered from the keyboard. The slope, m, of the line is computed as : m = (2-y1 `x2-x1 Accomplish the following for the given class diagram: Point 1.) Create the class implementation using C++ x : int y : int + Point( x: int, y : int ) + setXY( ): void + getX( ) : int + getY( ) : int 2.) Using the constructor, create 2 objects, P1 and P2, from class Point and store them in the stack memory. 3.) Implement the functions of the 2 objects. NOTE: The member function setXY is used to enter the values of x and y from the keyboard. Sample input/output display: Enter the coordinates of the 15t point (x1 y1): 1 1 Enter the coordinates of the 2nd point (x2 y2): 5 4 The slope of the line, m = 0.75

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
icon
Related questions
Question
100%

help me please, asap. i will give a thumbs up

By implementing the concepts of Classes and Objects, write a C++ program that determines
the slope of a line from the coordinates, P(x,y), of the 2 points. The coordinates of the 2
points: P1 (x1, y1) and P2(x2, y2) are to be entered from the keyboard. The slope, m, of the
22-y1)
line is computed as : m =
x2-х1
Accomplish the following for the given class diagram:
Point
1.) Create the class implementation using C++
x: int
2.) Using the constructor, create 2 objects, P1 and P2, from
y: int
+ Point( x : int, y : int )
+ setXY( ): void
+ getX( ) : int
+ getY ): int
class Point and store them in the stack memory.
3.) Implement the functions of the 2 objects.
NOTE: The member function setXY is used to enter the values of x and y from the
keyboard.
Sample input/output display:
Enter the coordinates of the 15t point (x1 y1): 1 1
Enter the coordinates of the 2nd point (x2 y2): 5 4
The slope of the line, m = 0.75
Transcribed Image Text:By implementing the concepts of Classes and Objects, write a C++ program that determines the slope of a line from the coordinates, P(x,y), of the 2 points. The coordinates of the 2 points: P1 (x1, y1) and P2(x2, y2) are to be entered from the keyboard. The slope, m, of the 22-y1) line is computed as : m = x2-х1 Accomplish the following for the given class diagram: Point 1.) Create the class implementation using C++ x: int 2.) Using the constructor, create 2 objects, P1 and P2, from y: int + Point( x : int, y : int ) + setXY( ): void + getX( ) : int + getY ): int class Point and store them in the stack memory. 3.) Implement the functions of the 2 objects. NOTE: The member function setXY is used to enter the values of x and y from the keyboard. Sample input/output display: Enter the coordinates of the 15t point (x1 y1): 1 1 Enter the coordinates of the 2nd point (x2 y2): 5 4 The slope of the line, m = 0.75
Expert Solution
steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Knowledge Booster
Multimedia tools and applications
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education