Thread: String program

  1. #1
    Registered User
    Join Date
    Mar 2005

    String program

    I need some help. Really really really bad. I've been sitting at my computer for days trying to figure this out, reading tutorial after tutorial, reading my book. And still I have nothing. I have a few little snippets of code. But nothing coherent. I just can't get it all. So I know a lot of you guys are really against giving out answers to homework problems, but I'm so desperate I figured I'd have to give it a try. But the up side is that this could give some of you programmers great practice, and having an example posted might help other people to. So I understand if this post merits no response. But I beg someone to reply, or send me a message, with the answer, full of comments so I can understand it, or a similar program so I can write my own based off of it. Thank you all so much for even reading this, and I'm sorry for asking this of you.

    The requirements are:

    1) Read a series of proper names from the console and save them in an array of strings.
    a) Create an array of at least 20 strings, each of which will hold at least 60 chars.
    b) Repeat the following until a string containing “nomore” with any capitalization is read from the console.
    i) Prompt the user for a person’s name or the keyword “nomore”.
    ii) Read a name from the console and copy it into the next available string in the array
    iii) Update a count of how many names are in the array.
    c) Display to the user the number of names that were read.
    2) Loop through the names in the array, applying “Proper Capitalization” to each name:
    a) Convert all characters in the name to lower case
    b) Trim leading and trailing blanks from the name
    c) Convert the first character of each part of the name to upper case (title, first name, middle name or initial, last name, suffix)
    d) Make sure that each single letter initial is followed by a period.
    e) Make sure the following suffixes are formatted as follows:
    MD, LLD, DDS, RN, LPN, PhD, and PE (add others if you wish)
    f) Display to the user all the names in their original and reformatted names.

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    >>I have a few little snippets of code. But nothing coherent.
    Then it's about time to pull it all together (including yourself! )

    The programs seem pretty simple; try starting small, with code you easily understand. Post it here when you have troubles.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Join Date
    May 2004
    >>I know a lot of you guys are really against giving out answers to homework problems

    You can ask for help without asking for the answer.
    Work on one problem at a time, show us some code and we will help you from there.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OOP Question DB Access Wrapper Classes
    By digioz in forum C# Programming
    Replies: 2
    Last Post: 09-07-2008, 04:30 PM
  2. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  3. Abnormal program termination
    By Kayoss in forum C++ Programming
    Replies: 3
    Last Post: 05-16-2006, 03:29 PM
  4. can anyone see anything wrong with this code
    By occ0708 in forum C++ Programming
    Replies: 6
    Last Post: 12-07-2004, 12:47 PM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM