Click here to Skip to main content
15,900,725 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
I have a project that I have to do in school and the question goes like this, I'm doing business and I don't know much about programming...The question goes like this? Please, I would appreciate it so much if someone can put me through on how to go about this.... It's due tomorrow...... I am not saying anybody should do the work for me but I'm only asking for general steps on how to do this work, getting started with it....Thanks! The question is to Cryptic Sentence Builder Program specification Write a program that:

1 - Accepts words from the user as console input.
2 - The user should enter ONE word at a time.
3 - When the user is finished entering words, the user should be able to just press the Enter key with no other input on a line to signal that the input process is finished.
4 - The program should assemble and display the words as a SINGLE sentence.
5 - The words of the sentence should be written out in the same order that they were typed in.
6 - Each individual word should be written out with its letters in reverse order.
7 - The maximum number of words that should be accepted is 64.
8 - The input process should end when the number of words exceeds 64.
9 - The user should be prompted to enter each word during the input process.
10 - Each word should be echoed back to the console after the user enters it.
11 - The echoed word should have the character ">" in front of it.
12 - The final sentence should be written out with "The sentence is:" in front of it.
13 - After displaying the sentence, there should be a prompt telling the user to press the Enter key to quit the program at the end.
14 - After displaying the prompt, the console output should remain on the screen until the user presses the Enter key.
15 - After the user presses the Enter key (when prompted to), the program should quit.
Here is an example of such a program's console output (user input in italic)- Enter a single word: 
one
>one
Enter
a single word:
two
>two
Enter
a single word:
three
>three
Enter
a single word:
four
>four
the sentence is:ruof eerht owt eno
*press the Enter key to quit* 

Posted
Updated 7-Dec-09 3:50am
v12

You have the structure already in the steps you have posted.

Use a list to store the strings the user entered, then to dump the output just iterate the list collection and word reversing the output using a loop.

All the info to do this will be in your course notes!

 
Share this answer
 
1. Accept the input and display it.
2. Reverse it and add it to a list.
3. Continue 1 and 2 until desired, and then accept a Return to stop accepting inputs.
4. Print "the sentence is: " and then iterate through the list and print everything.

How far have you achieved? Which programming language are you using?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900