Computer Science Canada help with total words in a sentence and total amount of each letter |
Author: | asianrandy [ Wed Dec 03, 2008 1:03 pm ] | ||
Post subject: | help with total words in a sentence and total amount of each letter | ||
help with total words in a sentence and total amount of each letter. lm closed to finising this assignment.
|
Author: | Tony [ Wed Dec 03, 2008 2:22 pm ] |
Post subject: | RE:help with total words in a sentence and total amount of each letter |
length(sentence) would count the number the characters (including spaces and punctuation!), not letters. You might find the index() function to be useful. |
Author: | asianrandy [ Thu Dec 04, 2008 8:09 am ] |
Post subject: | RE:help with total words in a sentence and total amount of each letter |
do i change length to count and make another line for length(sentence). |
Author: | asianrandy [ Fri Dec 05, 2008 4:09 pm ] | ||
Post subject: | RE:help with total words in a sentence and total amount of each letter | ||
i got the letters of the alphabets and i don't know the code to put it, to find the total words in a sentence and total amount of each letter.
|
Author: | Tony [ Fri Dec 05, 2008 4:36 pm ] | ||||
Post subject: | RE:help with total words in a sentence and total amount of each letter | ||||
That would count periods as letters. Also
You are not doing anything if the condition matches, although you've got the right idea. You just need a counter. As for the number of words in a sentence -- if it's a fair assumption that words are separated by a single space, then maybe you can count the number of spaces to figure out how many words they separate. |