How JustAnswer Works:

 
 
 
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
 
 
 
Ask LogicPro Your Own Question
LogicPro, Computer Software Engineer
Category: Programming
Positive Feedback: 99.4 %
Satisfied Customers: 7418
Experience: Expert in C, C++, Java, DOT NET, Python, HTML, Javascript, Design.
Type Your Programming Question Here...
LogicPro is online now
A new question is answered every 9 seconds

Rolodex project C++

Customer Question

This is due by midnight central time on April 3rd. Thanks to anyone who can help!


INSTRUCTIONS:
This goal of this project is to build an information manager similar to a rolodex.


Provide the following interactive commands in main() to work with your rolodex:
•list - displays all the cards in the rolodex, in alphabetical order from beginning to end.
•view - displays the card at the current position.
•flip - updates the current position to the next card, and displays it. Flipping past the last card wraps around to the first card.
•search - finds and displays a card, and makes it the current position in the rolodex. This command prompts for the last name for searching. If a matching card is found, it is displayed and is set as the current position. If no matching card is found, the card that immediately follows the lookup name is XXXXX XXXXX set as the current position (e.g. if "H" is entered as the last name, the first card with a last name following "H" in alphabetical order is displayed). If there is no following card, displays "Couldn't find: name" and the current position remains unchanged.
•add - adds a new card to the rolodex. Prompts for each field value, reads it, and enters the new card in the correct position in the rolodex (based on alphabetical order). The new card is set as the current position.
•remove - removes the card at the current position. It displays the card and prompts for a confirmation for removal. The following card is set as the current position.
•modify - updates the card at the current position. Enters a mode that requests the field to be updated (e.g. phone #), displays the existing value and prompts for the new value, reads it, and updates the card. Continues prompting for additional changes until all changes are done (e.g. a 0 is entered for the field # XXXXX change). If the last name is XXXXX XXXXX card must be moved to the correct position in the rolodex (and is set as the current position).
•quit - exits the program.

Design Notes
A Card class is used to represent a single Rolodex card. This class has member functions to allow getting and setting of data values (e.g. first name), and a display function that knows how to display the card on the supplied ostream parameter. Data members are std::string objects. This class does not know about Rolodex functionality, it just encapsulates a single card's information.

The Rolodex class manages a collection of Card objects. It must have a data member that is an STL container class to hold the set of rolodex Card objects (i.e. not a C/C++ array), and an associated STL iterator object to reference the current Card. The container used must be able to handle the case of duplicate names (e.g. two of XXXXX XXXXX, etc). The Rolodex member functions just manage the collection of Cards, and may have parameters or return values that are a Card object. The Rolodex class does not have code to read data for new cards, get updated data for existing Cards, or printing Cards. Data input is done by code in main() and Card objects are passed into and out of the Rolodex object. Displaying cards is done by the Rolodex code calling the Card's display member function, passing an ostream for it to display on. Some of your Rolodex member functions might include the following :

•add(...) takes a Card object as a parameter, adds it to the Rolodex collection (in the appropriate spot by last name), and sets it as the 'current card' in the Rolodex (by setting the internal iterator).

•remove() removes the current card from the Rolodex, returns it, and makes the following card the 'current' card. If the last card in the container is removed, the 'current' card should be set to the first card in the container (i.e. wraps around).

•getCurrentCard() returns the current Card (actually, a copy of it).

•flip() returns the next Card in the Rolodex, and updates the current card position.

•search(...) takes a search parameter, finds the requested card and sets it as the current card.

•show(...) takes an ostream as a parameter, iterates through
all the cards from beginning to end, invoking each card's show() method, and passing the ostream parameter. The Rolodex show() doesn't do any actual output - it just iterates through the collection and requests each card to display its contents by calling its show() member function. The current card remains unchanged.

The main() function creates and loads the Rolodex object with the starting data (by adding a series of Cards to it), and then accepts interactive requests that act on the Rolodex. For each interactive command, one or more member functions are invoked on the Rolodex from main(). For example, you might implement the interactive commands as follows:

•'list' can call Rolodex::show(...) to display the entire rolodex
•'view' can call getCurrentCard(), then call Card::show(...) on the returned Card.
•'flip' can call flip() to get the next Card, then call Card::show(...) on it.
•'add' prompts for all the info for a new Card, creates a new Card object with the information, then calls Rolodex::add(...) to add the new Card to the rolodex.
•'remove' gets the current Card from the Rolodex, calls Card::show(...) to display it as part of the confirmation prompt, and if 'yes' is entered, it calls remove() to remove the Card from the rolodex.
•'search' requests the name to search for, then calls search(...).
•'modify' gets the current Card, calls Card::show(...) to display it, prompts for the field to change, gets the new value from the user, updates the local Card object, and repeats until no more changes. The current (old) Card can then be removed by calling remove(), and the updated Card added by calling add(...). This will put the modified Card into the correct position in the rolodex (ie. the last name could have been changed), and set it as the current Card.

Note that some of the command processing code in main() requires several steps (like the add or modify commands) and may invoke several member functions on the Rolodex to complete a command. This keeps the Rolodex implementation *minimal*, and the Rolodex class doesn't do all the prompting, input, output, etc. The Rolodex class has basic functionality to manage the collection of Rolodex cards (which is a better design). The Rolodex class just maintains the collection of cards (in order), and provides functionality to add, remove, search for and get cards, list the collection of cards, maintains a 'current' card position, and can move the position to the next card. Specific output formatting, data entry, etc., is outside of the Rolodex class. When starting a class design, keep it as small as possible - it's always easier to add a new member function when there's a proven need, vs. trying to remove functions after the class is in use..
The Rolodex class must be able to handle the cases of adding or removing a card to the beginning or end of the collection, and 'wrapping around' from the end to the beginning of the collection when moving forward from the last card to the first card.

The Standard Library std::string class should be used for the character information (no char* or char arrays).

Submitted: 2 years ago.
Category: Programming
Expert:  LogicPro replied 2 years ago.

Hi,
Welcome to justanswer.
Do you have any code to start with?
If you have any file(s). Zip, upload the file to http://wikisend.com and post download link here.
Which c++ compiler you are using?

Customer: replied 2 years ago.

Hi,

Thanks for your assistance!

http://wikisend.com/download/202546/Rolodex.zip
Here is the code I have as of now (not sure if any will need to be edited for the final product), along with a main file which contains the card data I am required to enter into the program.

My compiler is Visual Studio 2010 Pro. Thanks!

Expert:  LogicPro replied 2 years ago.

Thank you for the information. I will check everything and reply in few hours.

Customer: replied 2 years ago.

Relist: I still need help.

Expert:  LogicPro replied 2 years ago.

I am working on it and will provide you answer before 3rd April.

Customer: replied 2 years ago.

Ok, thank you!

Expert:  LogicPro replied 2 years ago.

You're welcome.

Expert:  LogicPro replied 2 years ago.

It is half done. Just to let you know.

Expert:  LogicPro replied 2 years ago.

Download cpp file from here.

Ask me if you need more information.

LogicPro, Computer Software Engineer
Category: Programming
Positive Feedback: 99.4 %
Satisfied Customers: 7418
Experience: Expert in C, C++, Java, DOT NET, Python, HTML, Javascript, Design.
LogicPro and 7 other Programming Specialists are ready to help you
Customer: replied 2 years ago.

I already left you feedback, but I just wanted to say thanks so much for your great work! I appreciate your time and the hard work you did.

Expert:  LogicPro replied 2 years ago.

Thank you very much.

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
< Last | Next >
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
 
 
 

Meet The Experts:

 
 
 
  • ATLPROG's Avatar

    ATLPROG

    Computer Software Engineer

    Positive Feedback:

    99.8 %

    Satisfied Customers:

    7396
    MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
< Last | Next >
  • http://ww2.justanswer.com/uploads/SP/spatlanta2010/2011-6-23_12450_photo.64x64.gif ATLPROG's Avatar

    ATLPROG

    Computer Software Engineer

    Positive Feedback:

    99.8 %

    Satisfied Customers:

    7396
    MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Computer Software Engineer

    Positive Feedback:

    99.4 %

    Satisfied Customers:

    5551
    Expert in C, C++, Java, DOT NET, Python, HTML, Javascript, Design.
  • http://ww2.justanswer.com/uploads/unvadim/2010-11-15_210218_avatar.jpg unvadim's Avatar

    unvadim

    Computer Software Engineer

    Positive Feedback:

    99.7 %

    Satisfied Customers:

    1147
    Good knowledge of OOP principles. 3+ years of programming experience with Java and C++. Sun Certified Java Programmer 5.0.
  • http://ww2.justanswer.com/uploads/lifesaver333/2010-10-17_191349_ls.jpeg lifesaver's Avatar

    lifesaver

    Computer Software Engineer

    Positive Feedback:

    100.0 %

    Satisfied Customers:

    944
    Several years of intensive programming and application development experience in various platforms.
  • http://ww2.justanswer.com/uploads/RA/rajivsharma086/2012-6-6_17128_displaypic.64x64.jpg Raj's Avatar

    Raj

    Computer Engg.

    Positive Feedback:

    98.8 %

    Satisfied Customers:

    857
    BE CS, 4+ Experience in Programming and Database (ERP)
  • http://ww2.justanswer.com/uploads/EH/ehabtutor/2012-8-2_202016_1.64x64.jpg ehabtutor's Avatar

    ehabtutor

    Computer Software Engineer

    Positive Feedback:

    99.2 %

    Satisfied Customers:

    787
    Bachelor of computer science, 5+ years experience in software development, software company owner
  • http://ww2.justanswer.com/uploads/eljonis/2010-01-06_130406_eljon2.jpg Eljon's Avatar

    Eljon

    Consultant

    Positive Feedback:

    99.4 %

    Satisfied Customers:

    590
    11 yrs of programming (PHP, WordPress, XSL, SQL, JavaScript)