Quote (SlayingWhileInt0xicated @ Jun 11 2012 12:00am)
I feel like there is no simple way to do this and my teacher hasnt even gone over any of the suggestions im seeing on google

:wallbash:

ill do it for 25 fg
edit:: basically you need a couple vars to hold your data ex: total words, total sentences, avg words per sentence. and then you simply create a loop that reads in the text file character by character (which is the simplest for you seeing how you are already lost). another better more effiecient way is to read in data in chunks and then search your buffer for punctuation. and then calculate everything you need up to the punctuation and once you are done remove everything up to it from the buffer and shift the remaining data down to the beginning of the buffer.
ex: say if the text was
i love big black. do you love black horses? i know i do.
and you read in 10 characters at a time. your logic flow would be
Code
buffer[512]
while(not end of file)
{
buffer = read 10 chars
//buffer is now 'i love big'
if(search punctuation(buffer))
{
///punctuation was found
sentences++;
//count words in sentence for avg words per sentence.
remove sentance(buffer) //remove up to the punctuation and shift remander down.
//buffer now equals ' do'
}
else
{
buffer = read 10 more chars
//buffer now equals 'i love big black. do'
}
}
then again this is way to complicated for you and i just suggest go through char by char adding it to the buffer and checking if it equals any of your checks.
This post was edited by AbDuCt on Jun 10 2012 10:33pm