Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 cout

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

Step: 3

blur-text-image

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

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago