Questions tagged [readability]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
12 views

Readability for CS50 returning “Nan” value

I am fairly new to coding and im trying to complete Readability in Problem Set 2. I have coded how to count the letters, words, and sentences but now I am trying to make it calculate the grade level ...
0
votes
1answer
17 views

isalpha not counting

I am new to this and I'm doing the readability program. I'm using isalpha to count the letters and my program compiles but no matter what it says 0 and I can't figure out why. #include <cs50.h> #...
0
votes
2answers
29 views

Readability assignment, getting “Segmentation fault” message

It took me a while to be able to compile and run this program, and now I'm getting a "segmentation fault" message. What have I done wrong? Here's my code: #include <stdio.h> #include &...
0
votes
1answer
23 views

Readability CS50 Not counting the spaces

In my if statement I am trying to say, "if there is a space in strlen subtract that space then print strlen." My goal is to count only the letters that appear in the string and not the ...
0
votes
1answer
17 views

readability - resulting grade is incorrect

#include <stdio.h> #include <cs50.h> #include <ctype.h> #include <string.h> #include <math.h> int main(void) { string text = get_string("Text: "); ...
0
votes
1answer
21 views

Pset 2 - Readability -> Wrong grade

I'm having problems with the Pset 2 problem: readability. The goal of exercise is to implement a program that computes the approximate grade level needed to comprehend some text using the Coleman-Liau ...
0
votes
1answer
13 views

error: result of comparison against a string literal is unspecified (use strncmp instead) if(strncmp(i == “ ”))

I'm trying to write code for problem set 2, readability. I think I have it but I'm getting this error code and stuck on how to fix this. Here is my code if anyone could help that would be awesome! ...
0
votes
1answer
25 views

pset 2 Readability Segmentation Fault

I started working on readability and I am trying to figure out how to count the letters. I found a way but it includes all the characters so now I am trying to eliminate all the entries besides the ...
0
votes
1answer
19 views

Pset2 Readability error with “else” statement

readability.c:28:9: error: expected expression else: Shown above is the error I am getting. If anyone would point me to what exactly I am doing wrong. that would be great. Bellow, I will add my ...
0
votes
1answer
25 views

pset2 Readability: reading index being calculated incorrectly even though hard sentence, word and letter numbers are correct

The indexes come out sometimes too low,some times too high and I don't really understand why if the variable calculations come out right every time. Here's my code for it: //calculates average letters ...
0
votes
2answers
36 views

PSET2: Readability code giving wrong grades

My Readability code keeps on creating the outputs of the wrong grade when I try to execute it. When inputting the text, 'When he was nearly thirteen, my brother Jem got his arm badly broken at the ...
1
vote
1answer
70 views

What am I missing ? (pset2, readability)

The problem is that when i run check50 cs50/problems/2020/x/readability into the terminal, it says :( handles questions in passage Cause expected "Grade 2\n", not "Grade 3\n" Log ...
0
votes
1answer
44 views

Fatal error “segmentation fault” when trying to run program

My program readability.c compiles and gets input. It's supposed to return the number of letters in the input text. I'm getting this error instead of the answer. If you can help me you'll be welcome. ...
0
votes
1answer
55 views

Week 2 Readability Letter Count

I am able to figure out the number of letters and spaces (the answer is 300) with the code below. How do I write a command to exclude the spaces? A hint would be appreciated. Thank you. ''' #...
0
votes
1answer
29 views

Someone familiarized with pset2's Readability. I'm stuck here

I'm not asking for the solution, but I'm stuck in getting the integer of total letters. It doesn't compile but it's close, errors say it's something with isalpha. As it doesn't compile, I can't even ...
0
votes
2answers
28 views

Readability counting letters advice

I can't get to compile the readability program second part, that is counting the letters and outputting an integer. I've tried everything. I'm not asking for a solution, but for a hint at what my ...
0
votes
1answer
33 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
1answer
33 views

Pset2 Readability undeclared identifier error message

I am attempting to make my program but everytime I try, it tells me I have not identified my variable "i" eventhough I identified it as an integer above. Does anyone know what I'm doing ...
0
votes
1answer
18 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
1answer
32 views

pset2 Readability test question

This is what I have so far. I realized that when counting letters there are more symbols you must exclude, but I am not sure how to do that. Also, my program isn't running for some reason and I am not ...
0
votes
1answer
23 views

Readability pset: Please look at my code?

the program runs quite well but not accurate when check50 is applied #include <stdio.h> #include <math.h> #include <ctype.h> #include <string.h> #include <cs50.h> int ...
1
vote
2answers
52 views

My Coleman-Liau index gives the wrong answer

the program seems to be running fine but I don't know what went wrong in the index, it just doesn't give the right answer. #include <cs50.h> #include <stdio.h> #include <string.h> #...
0
votes
2answers
33 views

readability errors

I keep getting errors on the int i. idk what's wrong with my code #include <stdio.h> #include <cs50.h> #include <math.h> #include <string.h> int main(void) string text=...
1
vote
2answers
50 views

Hey. Please help me find my mistake. The number of words in my sentences is not counted properly

I tried using debugger but could not figure out where I went wrong. please help #include <stdio.h> #include <cs50.h> #include <string.h> #include <math.h> int main(void) { ...
0
votes
1answer
84 views

Pset 2 Readability

What's going wrong? I think I've got it figured out but I'm unable to compile the program and print out what I want it to say.
0
votes
1answer
120 views

Pset2 Readability. I am starting to do readbility and for some reason the code i wrote this far seems not to be compiling properly

My for loop doesn't seem to be executing. When i run the program it seems for loop is been skipped. Can someone please help me out. #include <stdio.h> #include <cs50.h> #include <string....
0
votes
1answer
63 views

Readability check50 error

#include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> #include <math.h> // Letters detects letters // Words detects spaces // Sentences detects ...
0
votes
1answer
38 views

Readability compiling issue

Readability (Problem Set 2) #include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> #include <math.h> // Letters detects letters // Words detects ...
0
votes
1answer
75 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
2answers
18 views

Why doesnt this code function?

I want to allow the user to put some text after a place holder via a printf like: Text: And then I want to be able to count the letters in the string. int main(void) { string text = get_string("...
0
votes
1answer
54 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
2answers
41 views

Pset 6 readability index constantly returns negative number

I'm having trouble getting an accurate value of the index. The output ends up being a negative number so the result always turns out as before grade one. I'm not sure where I went wrong from cs50 ...
0
votes
1answer
45 views

Having problems producung the correct result using the text extracts provided by CS%). I cant see where it goes wrong when finding the correct grade

CODE: #include <cs50.h> #include <stdio.h> #include <ctype.h> #include <string.h> #include <math.h> int main(void) { // DECLARE LETTER, WORD & SENTENCE COUNT int ...
0
votes
1answer
56 views

Pset2 readability

im trying to write this code in a particular way but my programme seems to keep getting the letter counts wrong. running debug 50 it seems that the bool i have created (letter) does not change from ...
0
votes
0answers
362 views

Problem set 2: readability.c

#include <stdio.h> #include <cs50.h> #include <ctype.h> #include <string.h> #include <math.h> int letter_counter(string text); int word_counter(string text); int ...
0
votes
1answer
334 views

Pset 6 Readability returns higher than expected grade

My code is right below I am unable to find the issue because my C code for readability was basically the same(except syntax and formatting of course!) and it was working perfectly. This Python code is ...
0
votes
1answer
197 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 ...
0
votes
2answers
54 views

pset2 readability. The brackets are in the wrong place but I can't figure out where they should go to make the program work correctly

include include include include include include int letters = 0; int words = 0; int sentences = 0; int main(void) { string text = get_string("Text: "); for (int i = 0, len = strlen(...
0
votes
1answer
75 views

Incompatible pointer to integer conversion passing 'int on functions

im new to coding and currently working on pset2, readability, and I keep getting this error and can´t find a way to fix it. #include <cs50.h> #include <stdio.h> #include <math.h> #...
0
votes
1answer
225 views

cs50 question. Pset2 Readability

hi i need help in making Readability. i get an error when i put in make readability. this the error i get. $ make readability clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-...
0
votes
1answer
204 views

pset2 readability. im getting 8 instead of 7th gread

Anyone knows why i get this error? :) readability.c exists :) readability.c compiles :( handles single sentence with multiple words expected "Grade 7\n", not "Grade 8\n" :) handles punctuation ...
0
votes
1answer
40 views

Copying an array (string) to new array after light mutating (pset2 readability)

I'm working on the readability task in pset2. I've made a new function which is going to count each letter in a string. What I want to do, is to get a user's input string, save it in a variable text ...
0
votes
0answers
25 views

Readability(checking punctuation to determine number of sentences)

here is my code; trying to detect punctuation (!, ., ?) to determine the amount of sentences, however keep getting error messages. would appreciate any help. my code and error messages are below; #...
0
votes
1answer
41 views

pset2 Readability - Wrong L and S

I'm struggling with the final calculation of the grade that results from the wrong value of L and S. Example: "One fish. Two fish. Red fish. Blue fish" counts letters: 29, words: 8, sentences: 3 ...
0
votes
1answer
56 views

Readability: facing an error "pointer cannot be cast to type 'float'

This is my code and I'am stuck at the last stage where index to be calculated. HOw to fix that? Error pops up: ( readability.c:50:42: error: pointer cannot be cast to type 'float') +++++++++++++++++++...
0
votes
1answer
179 views

can't get my readability program to work on all conditions- rounding issue?

My python readability program is not giving me the correct grade level for all of the checkers. specifically: "In my younger and more vulnerable years my father gave me some advice that I've been ...
0
votes
2answers
63 views

pset2 readability. cannot compile although int is declared and code is complete. could someone please look into?

#include<cs50.h> #include<stdio.h> #include<string.h> #include<ctype.h> #include<math.h> int main (void) { string text=get_string("text:\n"); // to count ...
0
votes
1answer
132 views

help with PS 2 Readability

Need help! Newbie alert over here - Readability program compiles fine, and print a return message, but I can't figure out why i keep getting the wrong grade number. Seems letter, word and sentence ...
0
votes
1answer
44 views

Why am I receiving a linker error on my function when it is defined in the file?

I'm in week 2 of cs50 and am currently working on the Readabilty problem. I've written a function named count_letters under main and have declared it at the top of the programm. However when I attempt ...
0
votes
1answer
166 views

Having issues creating readability and readability.c directory and file

I am a beginner and have zero knowledge of coding. Right now, I am working on problem set 2, but something is wrong and cant properly create readability.c and readability. This is what I am doing: ...