Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ Coding - Class # 8 B option: (The best grade is an 90%) Create a class to store Distance . Store the data points
C++ Coding - Class # 8
B option: (The best grade is an 90%) Create a class to store Distance . Store the data points x1, yl, x2, y2 in the private section of the class as doubles .Provide public member functions to set the values into the class .Provide a member function called GetDistance that returns the distance between the points Example of using the class void main( l/ create a Distance object Distance Double I/ set the values into the object; a.setx1(12.0) a.sety1 (20.0) a.setx2(40.0) a.sety2(50.0) length-a.GetDistance); cout at the top of your source code file to access these functions A option: (The best grade is a 100%) . Add a 4 parameter constructor that allows you to enter the data points when the object is created: . Provide public member functions to get the values from the class Distance a(2.0, 20.0, 20.0, 50.0); l/ create and set the values of a distance object coutStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started