Question: Help me get this code working with this additional class? RolodexEntryManager.cpp ------------------------------------- #include #include RolodexEntry.h #include #include #include using namespace std; //function dec void printMainMenu();

Help me get this code working with this additional class?

RolodexEntryManager.cpp

------------------------------------- #include #include "RolodexEntry.h" #include #include #include

using namespace std;

//function dec void printMainMenu(); void printEditMenu(vector & list); void editContactSub(const short c, vector & list); void printSearchMenu(vector & list); void printList(vector & list); void eraseEntry(vector & list, short index);

int main(void) { bool isRunning = true; vector list; do { char c; printMainMenu(); cin >> c; cin.ignore(INT_MAX, ' '); switch(tolower(c)) { case '1': case 'a': { RolodexEntry newEntry; newEntry.readIn(); list.push_back(newEntry); break; } case '2': case 'e': { printEditMenu(list); break; } case '3': case 'd': { printList(list); cout > c;

eraseEntry(list, c-1);//resizes and moves back break; } case '4': case 's': { printSearchMenu(list); break; } case '5': case 'p': { printList(list); break; } case '6': case 'q': { isRunning = false; break; } default: { cout

return 0; } void printMainMenu() { cout & list) { cout > c; cin.ignore(INT_MAX, ' '); editContactSub(c, list); return; } void editContactSub(const short c, vector & list)//and work { short index = c; if(index >= 0 && index (c)-1];

//edit menu cout > sel; cin.ignore(INT_MAX, ' ');

switch(tolower(sel)) { case '1': case 'f': { cout > newName; edited.setFName(newName); break; } case '2': case 'l': { cout > newName; edited.setLName(newName); break; } case '3': case 'a': { cout

cout

cout

cout > newzip; if(newzip > 99999)//long zip { edited.setZip(newzip); edited.setSZipLong();//finds szip from long zip } else { edited.setSZip(newzip); } break; } case '4': case 'p': { cout > newarea; edited.setArea(newarea);

cout > newex; edited.setExchange(newex);

cout > newLine; edited.setPLine(newLine); break; } case '5': case 'e': { cout > newemail; edited.setEmail(newemail); break; } } } else { cout & list)//and work { cout

char c; cin >> c; cin.ignore(INT_MAX, ' '); switch(tolower(c)) { case '1': case 'n': { cout

for(vector::size_type i = 0; i

for(vector::size_type i = 0; i

while(cin.fail()) { cin.clear(); cin.ignore(); } cin >> search;

for(vector::size_type i = 0; i

for(vector::size_type i = 0; i & list) { cout ::size_type i = 0; i & list, short index) { vector::size_type pos = index - 1; vector::size_type k;

if (pos = 0) { for (k = pos + 1; k != list.size(); k++) { list[k - 1] = list[k]; } list.pop_back(); } else { cout

using namespace std;

void RolodexEntry::printEntry() { cout > fName; cout > lName; cout

cout

cout

cout > tempZip; if(tempZip > 99999)//long zip { zip = tempZip; setSZipLong();//finds szip from long zip } else { szip = tempZip; } cout > area >> exchange >> line; cout > email; } ---------------------------------------------------------------------- RolodexEntry.h -----------------------------------------

#ifndef ROLODEXENTRY_H_INCLUDED #define ROLODEXENTRY_H_INCLUDED

#include //using namespace std; //base project only class RolodexEntry { private: std::string fName, lName, street, town, state; long zip; short szip, area, exchange, line; std::string email; public: RolodexEntry(void):fName(), lName(), street(), town(), state(), zip(000000000), szip(00000), area(0), exchange(0), line(0), email() {} RolodexEntry(std::string fname, std::string lname):street(), town(), state(""), zip(000000000), szip(00000), area(0), exchange(0), line(0), email() {} RolodexEntry(const RolodexEntry & r):fName(r.fName), lName(r.lName), street(r.street), town(r.town), state(r.state), zip(r.zip), szip(r.szip), area(r.area), exchange(r.exchange), line(r.line), email(r.email) {}

std::string getFName() const {return fName;} void setFName(std::string first){fName = first;} std::string getLName() const {return lName;} void setLName(std::string last){lName = last;} std::string getStreet() const{return street;} void setStreet(std::string str){street = str;} std::string getTown() const {return town;} void setTown(std::string newtown){town = newtown;} std::string getState() const {return state;} void setState(std::string newstate){state = newstate;} long getZip() const {return zip;} void setZip(long newzip){zip = newzip;} short getSZip() const {return szip;} void setSZipLong(){szip = zip / 10000;} void setSZip(short newszip){szip = newszip;} short getArea() const {return area;} void setArea(short newarea){area = newarea;} short getExchange() const {return exchange;} void setExchange(short exch){exchange = exch;} short getPLine() const {return line;} void setPLine(short newline){line = newline;} std::string getEmail(){return email;} void setEmail(std::string Email){email = Email;}

void printEntry();//other fns void readIn(); bool isEqual(RolodexEntry e){return e.fName == fName && e.lName == lName && e.street == street && e.town == town && e.state == state && e.zip == zip && e.szip == szip && e.area == area && e.exchange == exchange && e.line == line && e.email == email;} };

#endif // ROLODEXENTRY_H_INCLUDED

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 Databases Questions!