Help me start...

This is a discussion on Help me start... within the C++ Programming forums, part of the General Programming Boards category; Could someone help get me started on this assignment? Thanks... You’re working for a company that wants to take client ...

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    20

    Help me start...

    Could someone help get me started on this assignment? Thanks...

    You’re working for a company that wants to take client contact information as it is entered by a salesperson from a stack of business cards that he or she has collected, and output the information to a file (contacts.dat) in alphabetical order. Assume that there are never more than 100 cards to enter. The program should prompt the salesperson for each of the following values for each card:
    Last Name
    First Name
    Middle Name or Initial
    Title
    Company Name
    Street Address
    City
    State
    Zip Code
    Phone number
    Fax number
    Email address

    After the data are entered for each card, the user should be asked if there is another card to enter. This data should be sorted by Last Name, using a version of the SortedList class that will hold up to 100 struct values, each with a member corresponding to an item in the list above. Because the struct is so large, however, it will be more efficient if each element of the list array is a pointer to one of the struct values, and the class merely rearranges the pointers within the array in order to do the sorting. You should dynamically create a new struct value each componet of the list array to point to as the cards are input. The print function of the class will need to be modified to output the list to the contacts.dat file instead of cout. Each member of the struct should be written on a separate line. The function should also write the number of cards that are in the list as the first line of the file.

  2. #2
    Registered User
    Join Date
    Sep 2005
    Posts
    142
    Quote Originally Posted by RVDFan85
    Could someone help get me started on this assignment? Thanks...

    You’re working for a company that wants to take client contact information as it is entered by a salesperson from a stack of business cards that he or she has collected, and output the information to a file (contacts.dat) in alphabetical order. Assume that there are never more than 100 cards to enter. The program should prompt the salesperson for each of the following values for each card:
    Last Name
    First Name
    Middle Name or Initial
    Title
    Company Name
    Street Address
    City
    State
    Zip Code
    Phone number
    Fax number
    Email address

    After the data are entered for each card, the user should be asked if there is another card to enter. This data should be sorted by Last Name, using a version of the SortedList class that will hold up to 100 struct values, each with a member corresponding to an item in the list above. Because the struct is so large, however, it will be more efficient if each element of the list array is a pointer to one of the struct values, and the class merely rearranges the pointers within the array in order to do the sorting. You should dynamically create a new struct value each componet of the list array to point to as the cards are input. The print function of the class will need to be modified to output the list to the contacts.dat file instead of cout. Each member of the struct should be written on a separate line. The function should also write the number of cards that are in the list as the first line of the file.
    If you ever do this, i would be interested in seeing the code once you have finished, if you don't mind.
    <<snipped email address>>
    WhAtHA hell Is GoInG ON

  3. #3
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    No program will be written for you, read the homwork thread.

    Make a start on it and if you get stuck post what you have done with any errors ect
    I'm just trying to be a better person - My Name Is Earl

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,334
    Simple, you start with the basics of asking for information and seeing if you can just print it back out again.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 08:35 AM
  2. Adventures in labyrinth generation.
    By guesst in forum Game Programming
    Replies: 8
    Last Post: 10-12-2008, 01:30 PM
  3. C++ gui for windows where to start
    By prixone in forum Windows Programming
    Replies: 2
    Last Post: 12-16-2006, 10:48 PM
  4. GNOME Desktop won't start (Mandriva)
    By psychopath in forum Tech Board
    Replies: 10
    Last Post: 07-19-2006, 01:21 PM
  5. Start bar color in WinXP
    By confuted in forum Tech Board
    Replies: 4
    Last Post: 05-03-2003, 06:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21