Question: Create a Point class, implement Equality operator, Inequality operator, Comparison operator ( four ) , Insertion operator ( make it as friend of Point class
Create a Point class, implement Equality operator, Inequality operator, Comparison operator four Insertion operator make it as friend of Point class Arithmetic operators and Compound Assignment operator.
Show the Point class and explain to your teaching assistant step by step by using the four test cases.
Lastly, overload the subscript operator: dereference indirection operator: and apply Rule of three to the Array class given below by my code
Header File for step :
#include
#include
#include
using namespace std;
class Array
public:
explicit Arrayint sizeValue; constructor Use explicit when there is one paramater.
Arrayconst Array& origArray; copy constructor
~Array;
private:
int data;
int size;
CPP file for step :
#include "Array.h
#include
using namespace std;
Array::Arrayint sizeValue: sizesizeValue
data new intsizeValue;
Array::Arrayconst Array& myArray: sizemyArraysizeThis specific line of code still confuses me Specifically, const Array& myArray.
data new intmyArraysize;
for int i ; i myArray.size; i
datai myArray.datai;
Array::~Array
delete data;
I do not know what a friend function is I also do not know what an insertion operator is I have never heard of these things. Could you explain what these are and what to do for the problem? Below is the rest of the UML.
Private:
int x
int y
Public:
Pointint x int y constructor
operatorother: Point
operator!other: Point
operatorother: Point
operatorother: Point
operatorother: Point
operatorother: Point
operatorfriend of Point classNo idea what this is Please explain what an insertion operator isdoes as well as a friend function in addition to how to implement them.
operatorvalue: int
operatorvalue: int
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
