Here is Main
Here is the header fileCode:#include <iostream>
#include <string>
#include "warrents.h"
using namespace std;
class addressBook {
public:
explicit addressBook(string streetaddy, string phoneNumber)
: street(streetaddy), phone (phoneNumber)
{
}
void Address(string streetAddy)
{
street = streetAddy;
}
void PhoneNum(string phoneNumber)
{
phone = phoneNumber;
}
string getPhoneNum() const
{
return phone;
}
string getAddress() const
{
return street;
}
private:
string street;
string phone;
};
int main(int argc, const char * argv[])
{
addressBook address1("New York Way", "555-555-5554");
addressBook address2("New Jersey Bld","678-979-9999");
cout << "The first address is:"<<address1.getAddress()<<"\n "<< address1.getPhoneNum()<<endl;
cout << "The second address is:"<<address2.getAddress()<<"\n "<< address2.getPhoneNum()<<endl;
warrents recordChecker1("Boy are are good" "Girls are bad");
warrents recordChecker2("Girls are good" "Boys are bad");
cout << "The header file 1 says:"<<recordChecker1.getRecordBoy()<<endl;
cout << "The header file 2 says:"<<recordChecker2.getRecordGirl()<<endl;
return 0;
}
Code://
// warrents.h
#ifndef Classes_project_warrents_h
#define Classes_project_warrents_h
class warrents {
public:
explicit checkRecord::checkRecord std::string (badBoy), std::string (badGirl)
: boy (badBoy),girl (badGirl)
{
}
void recordBoy()
{
boy = badBoy;
}
void recordGirl()
{
girl= badGirl;
}
std::string getRecordBoy()
{
return girl;
}
std::string getRecordGirl()
{
return boy;
}
private:
std::string boy;
std::string girl;
};
#endif