1 Replies - 1617 Views - Last Post: 22 October 2013 - 09:17 PM Rate Topic: -----

#1 Deejay1992  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 26-November 12

Assistance with an Address Book C++ Program

Posted 22 October 2013 - 03:57 PM

Here is my assignment:

Using classes, design an address book application to keep track of the names, addresses, phone numbers and dates of birth of family members and close friends. Your program should be able to handle a maximum of 500 entries. Your program should have the following classes:

* DateType: Holds values for the month, day and year. This class should include a constructor, getters, setters and a function that returns the date formatted as a string. It should include at least minimal validation when setting the date parts (no days > 31, no negative months, etc.).

* AddressType: Stores a street address, city, state and ZIP code. It should include a constructor, getters, setters and a function that returns the address as a string.

* Person: Stores information related to a person including first name, last name, address (using the AddressType class), birthdate (using the DateType class), phone number and classification (family or friend). It should provide functions to store and print the appropriate information.

* AddressBook: Stores person objects. It should be able to process an unspecified number of entries. Use a dynamic structure from the STL for this.

The address book program should provide a menu to allow the user to perform the following operations

* Read in data from a file
* Sort the address book by last name
* Search for a person by last name
* Print the address, phone number, and date of birth of a given person
* Print the names of the people whose birthday are in a given month.
* Print the names of all family members or all friends

Addresstype.cpp

  #include "addressType.h"
#include "extPersonType.h"
#include "dataType.h"


addressType::addressType(void)
{
	StreetAddress="";
	City="";
	State="";
	Zip="";
}


addressType::addressType(string address, string city, string state, string zip)
{
	StreetAddress=address;
	City=city;
	State=state;
	Zip=zip;
}
void addressType::printAddress()
{
	cout<<"Street Address: "<<StreetAddress<<endl;
	cout<<"City          : "<<City<<endl;
	cout<<"State         : "<<State<<endl;
	cout<<"Zip code      : "<<Zip<<endl;
}

string  addressType::getStreet()
{
	return StreetAddress;
}
string addressType::getCity()
{
	return City;
}
string addressType::getState()
{
	return State;
}
string addressType::getZip()
{
	return Zip;
}




dataType.cpp

#include "extPersonType.h"
#include "addressType.h"
#include "dataType.h"

dateType::dateType(int m, int d, int y)
{
	month=m;
	day=d;
	year=y;
}

int dateType::getDay()
{
	return day;
}
int dateType::getMonth()
{
	return month;
}
int dateType::getYear()
{
	return year;
}
void dateType::printDate()
{
	cout<<"DOB: "<<month<<"/"<<day<<"/"<<year<<endl;
}




main.cpp

#include "extPersonType.h"
#include "dataType.h"
#include "addressType.h"
#include<fstream>

char displayMenu();
void readFromFile();
void writeToFile();
void sort();

class arrayListType
{
	extPersonType *arrayList;
	int size;
 public:
	 arrayListType(int n=500);
	 extPersonType & operator[](int i);
	 void removeLast();// remove last element
	 void add (const extPersonType &);// add new element
	 int getSize()const;// get arrayList size
 };

 arrayListType::arrayListType(int n)
 {
	arrayList=new extPersonType[n];
	size=n;
 }
 int arrayListType::getSize()const
 {
	return size;
 }
 void arrayListType::removeLast()
 {
	size--;
 }
 void arrayListType::add(const extPersonType &p)
 {
	arrayList[size++]=p;
 }
 extPersonType & arrayListType::operator[](int i)
 {
	return arrayList[i];
 }

 class addressBookType :public arrayListType 
{
 private:
	 extPersonType persons;
 public:
	
	void print(int i);// print personal data of [i] person
 };
 
 void addressBookType::print(int i)
 {
	 persons.printPersonDetails();
 }
 
 
int count=0;
addressBookType addressbook;
int main()
{
	bool flag=true;
	char ch;
	readFromFile();
	do
	{
		ch=displayMenu();
		switch(ch)
		{
		case '1':
			{
				string firstName;
				string lastName;
				string StreetAddress;
				string City;
				string State;
				string Zip;
				string phone;
				int month, day, year;
				int Type;
				cout<<"Enter first name: ";
				cin>>firstName;
				cout<<"Enter last name: ";
				cin>>lastName;
				cin.ignore();
				cout<<"Enter street addess: ";
				getline(cin,StreetAddress);
				
				cout<<"Enter city: ";
				cin>>City;
				cout<<"Enter State: ";
				cin>>State;
				cout<<"Enter Zip: ";
				cin>>Zip;
				cout<<"Enter date of birth: "<<endl;
				cout<<"Enter month: ";
				cin>>month;
				cout<<"Enter day: ";
				cin>>day;
				cout<<"Enter year: ";
				cin>>year;
				cout<<"Enter 1-Family member, 2-friend, 3-business associate: ";
				cin>>Type;
				cout<<"Enter phone number: ";
				cin>>phone;
				addressbook[count].setPerson(personType(firstName, lastName));
				addressbook[count].setDOB(dateType(month, day, year));
				addressbook[count].setAddress(addressType(StreetAddress, City, State, Zip));
				addressbook[count].setType(Type);
				addressbook[count].setPhone(phone);
				count++;
			}
			break;
		case '2'://>/>/Sort by last name
			{
				sort();
			}
			break;
		case '3'://>/>/search by last name
			{
				int total=0;
				string ln;
				cout<<"Enter last name to search: ";
				cin>>ln;
				for(int i=0;i<count;i++)
				{
					if(addressbook[i].getPerson().getLastName() == ln)
					{
						addressbook[i].printPersonDetails();
						addressbook[i].getType();
						cout<<endl<<"-----------------------------"<<endl;
						total++;
					}
				}
				cout<<endl<<"Match entries found: "<<total<<endl;
			}
			break;
		case '4'://>/>/Print the address, phone number, and date of birth
			{
				
				for(int i=0;i<count;i++)
				{
					addressbook[i].printPersonDetails();
					addressbook[i].getType();
					cout<<endl<<"-----------------------------"<<endl;
				}
				cout<<endl<<"Total entries: "<<count<<endl;
			}
			break;
		case '5'://>/>/Print the names of the people whose birthdays are in a given month
			{
				int total=0;
				int month;
				cout<<"Enter month of DOB to search: ";
				cin>>month;
				for(int i=0;i<count;i++)
				{
					if(addressbook[i].getDate().getMonth() == month)
					{
						addressbook[i].printPersonDetails();
						addressbook[i].getType();
						cout<<endl<<"-----------------------------"<<endl;
						total++;
					}
				}
				cout<<endl<<"Match entries found: "<<total<<endl;
			}
			break;
		case '6'://>/>/Print the names of all the people between two last names
			{
				sort();
				string ln1, ln2;
				cout<<"Enter last name 1: ";
				cin>>ln1;
				cout<<"Enter last name 2: ";
				cin>>ln2;
				for(int i=0;i<count;i++)
				{
					if(ln1 <= addressbook[i].getPerson().getLastName() && addressbook[i].getPerson().getLastName()<=ln2) 
					{
						addressbook[i].printPersonDetails();
						addressbook[i].getType();
						cout<<endl<<"-----------------------------"<<endl;
						
					}
				}
			}
			break;
		case '7'://>/>/Depending on the user's request, print the names of all family members friends, or business associates
			{
				int total=0;
				int type;
				cout<<"Enter 1-Family member, 2-friend, 3-business associate: ";
				cin>>type;
				for(int i=0;i<count;i++)
				{
					if(addressbook[i].getIntType()==type)
					{
						addressbook[i].printPersonDetails();
						addressbook[i].getType();
						cout<<endl<<"-----------------------------"<<endl;
						total++;
					}
				}
				cout<<endl<<"Match entries found: "<<total<<endl;
			}
			break;
		case '0':
			{
				writeToFile();
				flag=false;
			}
			break;
		}
	}while(flag);

	system("pause");
	return 0;
}

char displayMenu()
{
	char ch;
	do{
		cout<<endl<<"1. Add a address"<<endl;
		cout<<"2. Sort by last name"<<endl;
		cout<<"3. Search by last name"<<endl;
		cout<<"4. Print the address, phone number, and date of birth "<<endl;
		cout<<"5. Print the names of the people whose birthdays are in a given month"<<endl;
		cout<<"6. Print the names of all the people between two last names"<<endl;
		cout<<"7. Depending on the user's request, print the names of all family members friends, or business associates"<<endl;
		cout<<"0. Exit"<<endl;
		cout<<"Enter option: ";
		cin>>ch;
		if(ch=='1' || ch=='2' || ch=='3' || ch=='4' || ch=='5' || ch=='6' || ch=='7' || ch=='0')
			return ch;
		cout<<endl<<"ERROR: Invalid option entered"<<endl;
	}while(true);
}

void readFromFile()
{
	ifstream fin;
	fin.open("addresses.txt");
	string firstName;
	string lastName;
	string StreetAddress;
	string City;
	string State;
	string Zip;
	int month, day, year;
	int Type;
	string phone;
	while(fin>>firstName)
	{
		fin>>lastName;
		fin.ignore();
		getline(fin,StreetAddress);
		fin>>City;
		fin>>State;
		fin>>Zip;
		fin>>month;
		fin>>day;
		fin>>year;
		fin>>Type;
		fin>>phone;
		addressbook[count].setPerson(personType(firstName, lastName));
		addressbook[count].setDOB(dateType(month, day, year));
		addressbook[count].setAddress(addressType(StreetAddress, City, State, Zip));
		addressbook[count].setType(Type);
		addressbook[count].setPhone(phone);
		count++;
	}
	fin.close();
}

void sort()
{
	for(int i=0;i<count;i++)
	{
		for(int j=i+1;j<count;j++)
		{
			if(addressbook[i].getPerson().getLastName() > addressbook[j].getPerson().getLastName())
			{
				extPersonType tPerson;
				tPerson = addressbook[i].getPerson();
				addressbook[i].setPerson(addressbook[j].getPerson());
				addressbook[j].setPerson(tPerson);

				addressType tAddress;
				tAddress = addressbook[i].getAddress();
				addressbook[i].setAddress(addressbook[j].getAddress());
				addressbook[j].setAddress(tAddress);

				dateType tdate;
				tdate = addressbook[i].getDate();
				addressbook[i].setDOB(addressbook[j].getDate());
				addressbook[j].setDOB(tdate);

				int ttype;
				ttype=addressbook[i].getIntType();
				addressbook[i].setType(addressbook[j].getIntType());
				addressbook[j].setType(ttype);

			}
		}
	}
}




extpersonType.cpp

#include "addressType.h"
#include "dataType.h"
#include "extPersonType.h"

extPersonType::extPersonType()
{
}
extPersonType::extPersonType(extPersonType person, dateType dob, addressType address, string ph, int type)
{
	Person=person;
	DOB=dob;
	Address=address;
	Type=type;
	phonenumber=ph;
}
void extPersonType::setType(int type)
{
	if(type>=1 && type<=3)
		Type = type;
	else
		Type=1;
}
string  extPersonType::getType()
{
	if(Type==1)
		return "Family Member";
	else if (Type==2)
		return "Friend";
	else if(Type==3)
		return "Business Associate";
}
void extPersonType::printPersonDetails()
{
	Person.print();
	Address.printAddress();
	DOB.printDate();
	cout<<getType();
	cout<<endl<<"Phone: "<<phonenumber<<endl;
}
void extPersonType::setPhone(string ph)
{
	phonenumber=ph;
}

string extPersonType::getPhone()
{
	return phonenumber;
}
void extPersonType::setPerson(personType person)
{
	Person=person;
}
void extPersonType::setDOB(dateType dob)
{
	DOB=dob;
}
void extPersonType::setAddress(addressType address)
{
	Address=address;
}
personType  extPersonType::getPerson()
{
	return Person;
}

dateType extPersonType::getDate()
{
	return DOB;
}
int extPersonType::getIntType()
{
	return Type;
}

addressType extPersonType::getAddress()
{
	return Address;
}




dataType.h

#include<iostream>
#include<string>

using namespace std;


class dateType
{
	int month, day, year;
public:
	dateType(int m=1, int d=1, int y=1900);
	int getDay();
	int getMonth();
	int getYear();
	void printDate();
};





extPersonType.h

#include<iostream>
#include<string>

using namespace std;


class extPersonType 
{
public:
	string firstName;
	string lastName;
public:
	extPersonType();
	extPersonType(string first, string last);
	void print() const;
	void setName(string first, string last);
	string getFirstName() const;
	string getLastName() const;
};




addressType.h

#include<iostream>
#include<string>

using namespace std;

class addressType
{
private:
	string StreetAddress;
	string City;
	string State;
	string Zip;

public:
	addressType(void);
	addressType(string address, string city, string state, string zip);
	void printAddress();
	string  getStreet();
	string getCity();
	string getState();
	string getZip();
};






These are the errors that i am getting:

Error 1 error C2511: 'extPersonType::extPersonType(extPersonType,dateType,addressType,std::string,int)' : overloaded member function not found in 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 9 1 Address Book 1

Error 2 error C2039: 'setType' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 16 1 Address Book 1

Error 3 error C2065: 'Type' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 19 1 Address Book 1

Error 4 error C2065: 'Type' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 21 1 Address Book 1

Error 5 error C2039: 'getType' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 23 1 Address Book 1

Error 6 error C2065: 'Type' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 25 1 Address Book 1

Error 7 error C2065: 'Type' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 27 1 Address Book 1

Error 8 error C2065: 'Type' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 29 1 Address Book 1

Error 9 error C2039: 'printPersonDetails' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 32 1 Address
Book 1

Error 10 error C2065: 'Person' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 34 1 Address Book 1

Error 11 error C2228: left of '.print' must have class/struct/union c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 34 1 Address Book 1

Error 12 error C2065: 'Address' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 35 1 Address Book 1

Error 13 error C2228: left of '.printAddress' must have class/struct/union c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 35 1 Address Book 1

Error 14 error C2065: 'DOB' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 36 1 Address Book 1

Error 15 error C2228: left of '.printDate' must have class/struct/union c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 36 1 Address Book 1

Error 16 error C2065: 'phonenumber' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 38 1 Address Book 1

Error 17 error C2039: 'setPhone' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 40 1 Address Book 1

Error 18 error C2065: 'phonenumber' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 42 1 Address Book 1

Error 19 error C2039: 'getPhone' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 45 1 Address Book 1

Error 20 error C2065: 'phonenumber' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 47 1 Address Book 1

Error 21 error C2039: 'setPerson' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 49 1 Address Book 1

Error 22 error C2065: 'personType' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 49 1 Address Book 1

Error 23 error C2146: syntax error : missing ')' before identifier 'person' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 49 1 Address
Book 1

Error 24 error C2182: 'setPerson' : illegal use of type 'void' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 49 1 Address Book 1

Error 25 error C2059: syntax error : ')' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 49 1 Address Book 1

Error 26 error C2143: syntax error : missing ';' before '{' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 50 1 Address Book 1

Error 27 error C2447: '{' : missing function header (old-style formal list?) c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 50 1 Address Book 1

Error 28 error C2039: 'setDOB' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 53 1 Address Book 1

Error 29 error C2065: 'DOB' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 55 1 Address Book 1

Error 30 error C2039: 'setAddress' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 57 1 Address Book 1

Error 31 error C2065: 'Address' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book
1\extpersontype.cpp 59 1 Address Book 1

Error 32 error C2039: 'getPerson' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 61 1 Address Book 1

Error 33 error C2146: syntax error : missing ';' before identifier 'getPerson' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 61 1 Address
Book 1

Error 34 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\swedwardda\documents\visual studio
2010\projects\address book 1\address book 1\extpersontype.cpp 61 1 Address Book 1

Error 35 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 62 1 Address Book 1

Error 36 error C2065: 'Person' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 63 1 Address Book 1

Error 37 error C2039: 'getDate' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 66 1 Address Book 1

Error 38 error C2065: 'DOB' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 68 1 Address Book 1

Error 39 error C2039: 'getIntType' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 70 1 Address Book 1

Error 40 error C2065: 'Type' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 72 1 Address Book 1

Error 41 error C2039: 'getAddress' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 75 1 Address Book 1

Error 42 error C2065: 'Address' : undeclared identifier c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\extpersontype.cpp 77 1 Address Book 1

Error 43 error C2039: 'printPersonDetails' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 56 1 Address Book 1

Error 44 error C2039: 'setPerson' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 108 1 Address Book 1

Error 45 error C3861: 'personType': identifier not found c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 108 1 Address Book 1

Error 46 error C2039: 'setDOB' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 109 1 Address Book 1

Error 47 error C2039: 'setAddress' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 110 1 Address Book 1

Error 48 error C2039: 'setType' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 111 1 Address Book 1

Error 49 error C2039: 'setPhone' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 112 1 Address Book 1

Error 50 error C2039: 'getPerson' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 129 1 Address Book 1

Error 51 error C2228: left of '.getLastName' must have class/struct/union c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 129 1 Address Book 1

Error 52 error C2039: 'printPersonDetails' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 131 1 Address Book 1

Error 53 error C2039: 'getType' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 132 1 Address Book 1

Error 54 error C2039: 'printPersonDetails' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 145 1 Address Book 1

Error 55 error C2039: 'getType' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 146 1 Address Book 1

Error 56 error C2039: 'getDate' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 160 1 Address Book 1

Error 57 error C2228: left of '.getMonth' must have class/struct/union c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 160 1 Address Book 1

Error 58 error C2039: 'printPersonDetails' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 162 1 Address Book 1

Error 59 error C2039: 'getType' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 163 1 Address Book 1

Error 60 error C2039: 'getPerson' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 181 1 Address Book 1

Error 61 error C2228: left of '.getLastName' must have class/struct/union c:\users\swedwardda\documents\visual studio 2010\projects\address book
1\address book 1\main.cpp 181 1 Address Book 1

Error 62 error C2039: 'getPerson' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 181 1 Address Book 1

Error 63 error C2228: left of '.getLastName' must have class/struct
/union c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 181 1 Address Book 1

Error 64 error C2039: 'printPersonDetails' : is not a member of
'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 183 1 Address Book 1

Error 65 error C2039: 'getType' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 184 1 Address Book 1

Error 66 error C2039: 'getIntType' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 199 1 Address Book 1

Error 67 error C2039: 'printPersonDetails' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 201 1 Address Book 1

Error 68 error C2039: 'getType' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 202 1 Address Book 1

Error 69 error C2039: 'setPerson' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 269 1 Address Book 1

Error 70 error C3861: 'personType': identifier not found c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 269 1 Address Book 1

Error 71 error C2039: 'setDOB' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 270 1 Address Book 1

Error 72 error C2039: 'setAddress' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 271 1 Address Book 1

Error 73 error C2039: 'setType' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 272 1 Address Book 1

Error 74 error C2039: 'setPhone' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 273 1 Address Book 1

Error 75 error C2039: 'getPerson' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 285 1 Address Book 1

Error 76 error C2228: left of '.getLastName' must have class/struct/union c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 285 1 Address Book 1

Error 77 error C2039: 'getPerson' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 285 1 Address Book 1

Error 78 error C2228: left of '.getLastName' must have class/struct/union c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 285 1 Address Book 1

Error 79 error C2039: 'getPerson' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 288 1 Address Book 1

Error 80 error C2039: 'setPerson' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 289 1 Address Book 1

Error 81 error C2039: 'getPerson' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 289 1 Address Book 1

Error 82 error C2039: 'setPerson' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 290 1 Address Book 1

Error 83 error C2039: 'getAddress' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 293 1 Address Book 1

Error 84 error C2039: 'setAddress' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 294 1 Address Book 1

Error 85 error C2039: 'getAddress' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 294 1 Address Book 1

Error 86 error C2039: 'setAddress' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 295 1 Address Book 1

Error 87 error C2039: 'getDate' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 298 1 Address Book 1

Error 88 error C2039: 'setDOB' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 299 1 Address Book 1

Error 89 error C2039: 'getDate' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 299 1 Address Book 1

Error 90 error C2039: 'setDOB' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 300 1 Address Book 1

Error 91 error C2039: 'getIntType' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 303 1 Address Book 1

Error 92 error C2039: 'setType' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 304 1 Address Book 1

Error 93 error C2039: 'getIntType' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 304 1 Address Book 1

Error 94 error C2039: 'setType' : is not a member of 'extPersonType' c:\users\swedwardda\documents\visual studio 2010\projects\address book 1\address book 1\main.cpp 305 1 Address Book 1


Please help....

Is This A Good Question/Topic? 0
  • +

Replies To: Assistance with an Address Book C++ Program

#2 jimblumberg  Icon User is offline

  • member icon


Reputation: 4142
  • View blog
  • Posts: 12,892
  • Joined: 25-December 09

Re: Assistance with an Address Book C++ Program

Posted 22 October 2013 - 09:17 PM

Where have you defined a constructor with the following signature?

extPersonType::extPersonType(extPersonType person, dateType dob, addressType address, string ph, int type)
{


The same for several of the other errors, you need to define those functions in your class.

Jim
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1