Question: Record.h #ifndef RECORD_H #define RECORD_H #include using namespace std; //Record class class Record { private: //private data member int recordNumber; string firstName; string lastName; int

Record.h

#ifndef RECORD_H #define RECORD_H #include  using namespace std; //Record class class Record { private: //private data member int recordNumber; string firstName; string lastName; int age; int telephone; public: //default constructor Record(); //parameterized constructor Record(int, string, string, int, int); //getter functions int getRecordNumber(); string getFirstName(); string getLastName(); int getAge(); int getTelephone(); //setter functions void setRecordNumber(int); void setFirstName(string); void setLastName(string); void setAge(int); void setTelephone(int); void print(); }; #endif

Record.cpp

#include  #include  #include"Record.h" using namespace std; //default constructor Record::Record() { recordNumber = 0; firstName = ""; lastName = ""; age = 0; telephone = 0; } //parameterized constructor Record::Record(int rno, string fn, string ln, int ag, int tno) { recordNumber = rno; firstName = fn; lastName = ln; age = ag; telephone = tno; } //getter functions int Record::getRecordNumber() //returns the recordNumber { return recordNumber; } string Record::getFirstName() //returns the firstname { return firstName; } string Record::getLastName() //returns the lastname { return lastName; } int Record::getAge() //returns the age { return age; } int Record::getTelephone() //returns the telephone { return telephone; } //setter functions void Record::setRecordNumber(int rno) //set the recordNumber { recordNumber = rno; } void Record::setFirstName(string fn) //set the firstname { firstName = fn; } void Record::setLastName(string ln) //set the lastname { lastName = ln; } void Record::setAge(int ag) //set the age { age = ag; } void Record::setTelephone(int tno) // //set the telephone { telephone = tno; } void Record::print() //print a record { cout<> op; switch(op) { case 1: //Input information into an record cout<<"Enter first name: "; cin >> firstName; cout<<"Enter last name: "; cin >> lastName; cout<<"Enter age: "; cin >> age; cout<<"Enter telephone number: "; cin >> telephone; rec[n] = Record(n+1, firstName, lastName, age, telephone); n++; break; case 2: //Display all information in all records cout<<"Record Number FirstName LastName Age Telephone-Number"<

make new program by modifying the address book program above; modify the program to use the Array Class instead of a basic array; make another new program by modifying the address book program above to use the Vector Class instead of a basic array. Implement exception catching in appropriate areas that may cause errors; implement exception catching in at least one area of the program for each of the Array class and Vector class in the programs created; will need the code for two finished independent programs (Array and Vector). need to separate the implementation of the classes from the header files; and have a .cpp file and a .h file for each class created.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!