Question: in c + + 1 4 . 4 6 Lab ( CH 7 ) : Triangles In Space In this lab you will expand your

in c++14.46 Lab (CH7): Triangles In Space
In this lab you will expand your SpacePoint class to include the listed member functions.
You will also create TriangleClass functions needed to represent a triangle w/ points in space.
See Default Template for details on functions needed.
Once you have tested your new class functions, you can safely output "ALL TESTS PASSED!" with endline to indicate code is completed.
using: #include
#include
using namespace std;
class SpacePoint {
public:
void SetCoords(int x, int y); // Sets the value for member variables xCoord and yCoord
int GetX(); // returns xCoord
int GetY(); // returns yCoord
void Print();
// SpacePoint operator+(SpacePoint b); // Overloads '+' operator and adds two points:
//(x1,y1)+(x2,y2) is (x1+x2, y1+y2)
private:
int xCoord;
int yCoord;
};
class TriangleClass {
public:
void SetPoints(SpacePoint Ain, SpacePoint Bin, SpacePoint Cin);
double GetArea();
void Print();
private:
SpacePoint A;
SpacePoint B;
SpacePoint C;
};
int main(){
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!