A data member to hold the meter value


Please create a class, PersonHeight, to represent the person's height. Our class will include the following members: 
a) A data member to hold the meter value 
b) Another data member to hold the centimeter value 
c) The corresponding get/set methods for the given data members 
d) Overload - operator so that the difference of two instances of PersonHeight can be calculated. 
e) Overload > operator to compute if a PersonHeight object is greater than another one. 
f) Overload == operator to compute whether two PersonHeight objects are equal or not. 
g) Overload != operator for PersonHeight class. ( != operator will return "true" if the heights of two given operands are not equal, "false" otherwise.) 
To test your class in the main function, use the operators and methods you have implemented. Test your program by reading 7 pairs of meter-centimeter values from the user. Also, try using array of objects. 
2. Think about how to overload the above operators as non-member functions 
---
I create a class
PersonHeight{
int meter=0;
int centimeter=0;
}
void get m_value() {
return meter;}
void get c_value() {
return centimeter;}
void set m_value(int m) {
meter=m;}
void set m_value(int c) {
centimeter=c;}

Do parts which are related with the overloading.

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: A data member to hold the meter value
Reference No:- TGS0111802

Expected delivery within 24 Hours