Question: Using classes, design an online address book to keep track of the names, addresses, phone numbers, and dates of birth of family members, close friends,
Using classes, design an online address book to keep track of the names, addresses, phone numbers, and dates of birth of family members, close friends, and certain business associates. Use the included personType.h and personTypeImp.cpp files as well as the dateType.h and dateTypeImp.cpp files to complete the assignment.
USE C++
This is one question, please read the instructions and do not copy the other answers to this question that were already submitted, they are incorrect and or missing the rest of the program.
Step 1. Define a class addressType that can store a street address, city, state, and ZIP code. Use the appropriate functions to print and store the address. Also, use constructors to automatically initialize the member variables.
Step 2. Create extPersonType as a derived class using personType as the base class, include the addressType class and the dateType class as a data member objects in the extPersonType class using Composition. Add a member variable to this class to classify the person as a family member, friend, or business associate. Also, add a member variable to store the phone number. Add (or override) the functions to print and store the appropriate information. Use constructors to automatically initialize the member variables.
Step 3. Define the class addressBookType using the previously defined classes. The program should perform the following operations:
- Provide the user a menu option with the ability to enter the personal information, the date of birth information and the address information. You will need to create an array of 10 addressBookType objects and write data to an object to the array as the user data in entered. The user should have the ability to use this menu option in the program to enter another object. You will need to keep track of the number of objects entered to make sure the user cannot enter more than 10 objects.
- Provide a menu option to search by name and print the address, phone number and date of birth if the name exists. Give an appropriate message if the name is not found.
- Provide a menu option to enter a month of the year and display the name, address, and phone number of the entries with birthdays in that month.
- Provide a menu option to enter the classification of a person (family, friend, or business) and display the name, address, and phone number of the entries with birthdays in that month.
- Provide a menu option to exit the program.
- Make sure the user does not exceed the 10-max limit of addressBookType objects at any point during the program.
BELOW ARE THE INCLUDED FILES REQUIRED TO COMPLETE THIS ASSIGNMENT
personType.h file
//personType.h #ifndef H_personType #define H_personType #include using namespace std;
class personType { public: void print() const; void setName(string first, string last);
string getFirstName() const;
string getLastName() const;
personType(string first = "", string last = "");
private: string firstName; string lastName; };
#endif
personTypeImp.cpp file
//personTypeImp.cpp
#include #include #include "personType.h" using namespace std;
void personType::print() const { cout << firstName << " " << lastName; }
void personType::setName(string first, string last) { firstName = first; lastName = last; }
string personType::getFirstName() const { return firstName; }
string personType::getLastName() const { return lastName; }
//constructor personType::personType(string first, string last) { firstName = first; lastName = last; }
dateType.h file
#ifndef dateType_H #define dateType_H class dateType { public: void setDate(int month, int day, int year);
int getDay() const;
int getMonth() const;
int getYear() const;
void printDate() const;
dateType(int month = 1, int day = 1, int year = 1900);
private: int dMonth; int dDay; int dYear; };
#endif
dateTypeImp.cpp file
//Implementation file date #include #include "dateType.h"
using namespace std;
void dateType::setDate(int month, int day, int year) { dMonth = month; dDay = day; dYear = year; }
int dateType::getDay() const { return dDay; }
int dateType::getMonth() const { return dMonth; }
int dateType::getYear() const { return dYear; }
void dateType::printDate() const { cout << dMonth << "-" << dDay << "-" << dYear; }
//Constructor with parameters dateType::dateType(int month, int day, int year) { dMonth = month; dDay = day; dYear = year; }
I'm not really sure what you mean by "need more details", everything to do the assignment is already here. The addressType, extPersonType, and addressBookType files all require their a HEADER file and IMPLEMENTATION file. After those file are created, a main.cpp file is required.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
