Hey guys, can you help me out with this exam review question that states:
Give the following declarations for a class, write C++ code where indicated. Use the comments to help you understand what each function does. Include the required libraries.
// this is in the .h file
class personType
{
private:
double salary;
string name;
public:
//default constructor - sets salary to 0.0 and name to "No name"
personType ();
// This function compares two objects of personType
// returns true of identical, false otherwise
bool isEqual( personType x);
// This function prints the values int he data members
void print () const;
// This function reads the value of the salary and the name
void readInfo( personType x);
};
personType::
{
//default constructor - write the heading and the body
}
bool
{
//isEqual function
//write the heading and the body
}
void
{
//readInfo function
//write the heading and the body
}
void
{
//print function
//write the heading and the body
}
void main()
{
// this is the main program file
//declare arrays called staff of 3 objects of the personType class
//the first object has the values 10000.00 and the name is Smith, the second object has 25000
//and Jacob, and the last object has 25000 and the name is Smith
//Write a C++ statement to compare the staff[0] with staff[2]
//Write a C++ statement here to print out the data members of each staff object
system("pause")
}
You have not even attempted to do anything with this yet - no one will help you. The solutions are actually found easily on google, put in some effort and someone may help you.