Questions tagged [pset2-readability]
The pset2-readability tag has no usage guidance.
19 questions
1
vote
1
answer
26
views
Problem set 2 - Readability
I'm trying to solve the Readability set but I'm not able to pass the condition for the question case.
When I run check50, I get this error.
Cause
expected "Grade 2\n", not "Grade 3\n&...
0
votes
1
answer
30
views
i cannot see what is wrong but each time i type an input i get the answer in negative numbers aka "before grade 1"
#include <cs50.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <math.h>
int count_letters(string text);
int count_words(string text);
int ...
0
votes
1
answer
53
views
pset2 readability test not calculating correct grade
I believe I've written the readability.c program correctly to count letters, words, and sentences based on readability prompt and calculate the grade index. But whenever I test the grade index, I'm ...
0
votes
1
answer
27
views
Readability can't compile. Error : expected '(' after 'if'
#include <cs50.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <math.h>
int main(void)
{
//prompt user for a string
string text = ...
0
votes
1
answer
17
views
pset2, readability, test not passing(stuck in a non terminating loop), not sure what's the problem
#include <cs50.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
int count_letters(string text);
int main(void)
{
string input = get_string("Text: ");...
0
votes
1
answer
869
views
CS50 Readability solution unsolvable to me
I coded this solution myself, but I really can't figure out where I did wrong, I've spent days on this, and I would really appreciate any help!! Please, 😭
#include <cs50.h>
#include <stdio.h&...
0
votes
0
answers
48
views
Readability (pset2) - Sanity check
Consider the following scenario:
If I write the text below it gives me an expected Grade 3, but if I write just "Congratulations!" it gives me an unexpected Grade 42 (16+):
~/readability/ $ ....
0
votes
2
answers
355
views
When I try to execute the file is says "bash: ./: Is a directory"
When I try to execute the file, for example "./ readability" is says "bash: ./: Is a directory". It just started doing this the past few days. I even tried running files that ...
0
votes
1
answer
85
views
readability pset2 multi error
I replaced semicolon with a coma as sugested erlier. I compile the code but when I enter the text to receive Grade 3 nothing happens, again anny sugestion. Thanks.
#include <cs50.h>
#include <...
1
vote
2
answers
52
views
CS50 Readability compile error
Im trying to compile the program but keep getting this error message below:
Can someone tell me what this means please. The carat arrow is supposed to be pointing at "char" and "ch&...
1
vote
2
answers
293
views
pset2 - readability - grades slightly off
I have a problem that I have not been able to diagnose on my own or by perusing this stack overflow.
The the tests are here.
All of the index values are correct except for the grade seven sentence ...
0
votes
1
answer
112
views
Pset2 Readability Not Working
I need help in executing the program here. This is my program and when I execute it, it asks me for a text. I copy-pasted the first HOW TO TEST YOUR CODE "One fish. Two fish. Red fish. Blue fish.&...
0
votes
1
answer
116
views
Pset2 Readability: Counting words and sentences
whenever I try to run my readability code I always get that I have no words or sentences. Additionally, whenever I run my code the number of letters seems to include spaces eventhough I am using the ...
0
votes
1
answer
125
views
Sentence count stuck at 2 in readability
#include <stdio.h>
#include <cs50.h>
#include <ctype.h>
#include <string.h>
int main(void)
{
//Retrieve string of text from user
string s = get_string("Text: &...
0
votes
1
answer
36
views
pset2 readability counting with global variables
I have been having some trouble forming a proper global function for CS50 pset2 readability. The code has no error after compiling but the index will not count. I'm not sure if the global counter ...
0
votes
1
answer
301
views
PSET2 Readability - tests no passing
I am not sure what I am doing wrong.
#include <stdio.h>
#include <cs50.h>
#include <ctype.h>
#include <string.h>
#include <math.h>
int main(void)
{
//Create integers ...
0
votes
1
answer
95
views
Pset2 Coleman-Lau Index Always Prints -15
I'm struggling with PSet 2 Readability. I don't want to cheat the answers because I am genuinely trying to learn how to think better and improve my logic.
I so far have been able to get the letter ...
0
votes
1
answer
473
views
Pset2 Readability test fail "complex single sentence" Grade 9 instead of Grade 8
When using check50 or inputting the provided texts, my program passes all but one test; the "complex single sentence" test returns a Grade 9 instead of Grade 8 (Coleman-Liau index returns 8.785455 and ...
1
vote
1
answer
18
views
I have tried and looked through my code but every output it prints is Before Grade 1. And it is compiling without errors
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
int main(void)
{
int l_count = 0;
int w_count = 1;
int s_count = 0;
int L = ((float)...