Write a program in C++ using arrays, C-trings, classes, and libraries. Write a program to handle a user's rolodex entries. (A rolodex is a system with tagged cards each representing a contact. It would contain a name, address, and phone number. In this day and age, it would probably have an email address as well.) Typical operations people want to do to a rolodex entry are: 1) Add entry 2) Edit entry 3) Delete entry 4) Find entry 5) Print all entries 6) Quit You can decide what the maximum number of rolodex entries is and how long each part of an entry is (name, address, etc.). When they choose to edit an entry, give them the option of selecting from the current rolodex entries or returning to the main menu — don't force them to edit someone just because they chose that option. Similarly for deleting an entry. Also don't forget that when deleting an entry, you must move all following entries down to fill in the gap. If they want to add an entry and the rolodex is full, offer them the choice to return to the main menu or select a person to overwrite. When they choose the print option, make a nicely formatted table of their current entries (if any). When they choose to find an entry, go to a submenu: 1) find by Name 2) find by Address 3) find by Phone number 4) find by Email address 5) Return to Main Menu All of these searches are to be case-insensitive content searches. (In other words, if the rolodex contains a person named Vishal Herrera, they should be found by searches by name of: sh, SH, al h, al H, herrera, HERRERA, etc. as well as of Vishal Herrera.) Question: Should you print all matches to a search or just the first one? All menus are to be choosable by both number and capitalized letter(s). Hint: You'll only have one class — most likely. It might look something like this: const size_t MAX_NAME = ???, MAX_STREET = ???, MAX_TOWN = ???, MAX_STATE = 3, MAX_PHONE = 14, // ...other MAX's... class RolodexEntry { char fname[MAX_NAME], lname[MAX_NAME]; // together or separate? char street[MAX_STREET], town[MAX_TOWN], state[MAX_STATE]; long zip; short zip_4; char phone[MAX_PHONE]; public: // ...ctor's, accessors, mutators, i/o, equality, etc. }; Hint: This class should have its own library. Other libraries may also be used for collections of functions (like a generic list searching function? or special string searching functions).
Write a program in C++ using arrays, C-trings, classes, and libraries.
Write a program to handle a user's rolodex entries. (A rolodex is a system with tagged cards each representing a contact. It would contain a name, address, and phone number. In this day and age, it would probably have an email address as well.)
Typical operations people want to do to a rolodex entry are:
1) Add entry
2) Edit entry
3) Delete entry
4) Find entry
5) Print all entries
6) Quit
You can decide what the maximum number of rolodex entries is and how long each part of an entry is (name, address, etc.).
When they choose to edit an entry, give them the option of selecting from the current rolodex entries or returning to the main menu — don't force them to edit someone just because they chose that option.
Similarly for deleting an entry. Also don't forget that when deleting an entry, you must move all following entries down to fill in the gap.
If they want to add an entry and the rolodex is full, offer them the choice to return to the main menu or select a person to overwrite.
When they choose the print option, make a nicely formatted table of their current entries (if any).
When they choose to find an entry, go to a submenu:
1) find by Name
2) find by Address
3) find by Phone number
4) find by Email address
5) Return to Main Menu
All of these searches are to be case-insensitive content searches. (In other words, if the rolodex contains a person named Vishal Herrera, they should be found by searches by name of: sh, SH, al h, al H, herrera, HERRERA, etc. as well as of Vishal Herrera.)
Question: Should you print all matches to a search or just the first one?
All menus are to be choosable by both number and capitalized letter(s).
Hint: You'll only have one class — most likely. It might look something like this:
const size_t MAX_NAME = ???,
MAX_STREET = ???,
MAX_TOWN = ???,
MAX_STATE = 3,
MAX_PHONE = 14,
// ...other MAX's...
class RolodexEntry
{
char fname[MAX_NAME], lname[MAX_NAME]; // together or separate?
char street[MAX_STREET], town[MAX_TOWN], state[MAX_STATE];
long zip;
short zip_4;
char phone[MAX_PHONE];
public:
// ...ctor's, accessors, mutators, i/o, equality, etc. };
Hint: This class should have its own library. Other libraries may also be used for collections of functions (like a generic list searching function? or special string searching functions).
Trending now
This is a popular solution!
Step by step
Solved in 2 steps