I am currently stuck at a problem for a few days to find out why it's happening.
I am writing a program to find out number of letters, words, and sentences. Using these values, I am using Coleman-Liau index to find out the article's readability level.
I think I have a pretty solid program with the help online but I don't know why some of the errors are happening in the link below. https://submit.cs50.io/check50/35e7ae7e4b968d6b06a8152f61a0e83381b376ab
For context, please see https://cs50.harvard.edu/college/psets/2/readability/
Here's the code that I am having trouble with:
[removed solution code per Academic Honesty guidelines]
// calculate Coleman-Liau index int grade = 0.0588 * (100 * letter / word) - 0.296 * (100 * sentence / word) - 15.8; // debugger printf("Letters: %i\n Words: %i\n Sentences: %i\n", letter, word, sentence);
Could anyone help me find out what the problem is? as far as I can see, I can't see why some of the results are skewed.