Questions tagged [cs50x2020]

The tag has no usage guidance.

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

pset3 - plurality - failing check50 'print multiple winners' - but my own tests say it works, not sure what I'm missing

I'm not sure why my program is failing check50, when I run my own tests it does seem to print multiple winners, but check50 says it doesn't print multiple winners [removed solution code]
0
votes
1answer
13 views

Why is my recover code not giving any output?

I'm very confused why this code is not giving any output: Code: #include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; long int findSize(char file_name[]) ...
0
votes
0answers
20 views

pset4 (less) filter - blur please help

I've been stuck on this project for a while... I looked at other people's questions but still cannot find our where I did wrong. Can someone help me see where the bug is... void blur(int height, int ...
0
votes
1answer
34 views

Pset1 Cash less comfortable - not running for 0.41 and 0.01

-- hi im running into a problem with my code. It's executed pretty well with many inputs except for 0.41 and 0.01. It didn't print out any answer but just ran indefinitely... #include <stdio.h> #...
0
votes
0answers
28 views

“Error when executing query: too many statements at once” pset 7 movies

Hi! I wanted to know what this error message meant because all my sql statements give the correct output but submit50 shows that i've only got a 2/14 , "Error when executing query: too many ...
0
votes
0answers
40 views

PSET5 dictionaries won't load

I cannot get my dictionaries to load and cannot figure out why. Here is my load function: // Loads dictionary into memory, returning true if successful else false bool load(const char *dictionary) { ...
0
votes
1answer
49 views

incompatible pointer types passing 'string' (aka 'char *') to parameter of type 'string *' (aka 'char **')

Im writing a funtion that takes string as a argument and gives back a integer. This function counts lenght of a string entered at the command line argument. I get an error :" incompatible pointer ...
1
vote
1answer
28 views

Making code neater: a way to reduce repeated logical operators?

For CS50 pset1 Credit I'm using repeated logical-OR operators (||) to work out the validity and card brand of a credit card number. When I evaluate the style of my code using style50 it says to insert ...
0
votes
1answer
49 views

How do you find the first digit of a long number?

I wrote the following code to try to find the first digit of a long number (this is for the CS50x "Credit" exercise), but it's not working. Any tips? // Conditions and relational operators #...
0
votes
3answers
147 views

PSET 5 Hash help

I started my load function without looking at any reference code (first time starting a pset this way) to give me an idea on how to implement my own version. I was mostly confident until I reached the ...
1
vote
1answer
21 views

CS50 recover (fclose giving segmentation fault)

found a few answers to the segmentation fault issue in CS50 recover while closing the file but I couldn't translate the answers to my issue: The last part: fclose(f); fclose(img); is resulting into ...
1
vote
2answers
118 views

PSET 4 Reflect help

I am not sure why I am having issues with my code. I know I can store the rgb values for the left pixels in 3 temporary variables then assign the right values to the left and the temp values to the ...
0
votes
1answer
151 views

PSet 6: DNA gives correct as well as wrong ouput

Problem Set 6: DNA gives output No Match No Match No Match No Match No Match No Match No Match No Match No Match No Match Lavender No Match No Match No Match No Match No Match No Match No Match No ...
0
votes
1answer
132 views

PSet5 case-insensitive using strcasecmp

Tried iteration over strlen and random constant variable but unable to solve: :( spell-checking is case-insensitive expected "MISSPELLED WOR...", not "MISSPELLED WOR..." Here is my full code: //...
0
votes
2answers
36 views

PSET4 recover. Why doesn't my counter increase?

Below is my working code but I've a question. If change my char filename[8] to char filename[7] the counter does not increase. Instead, I'll only have 2 output files: 000.jpg and 001.jpg, where 001....
0
votes
0answers
83 views

Cs50x final project ideas

I just finished the web track and now I'm planning to do the final project but cant seem to figure out what I should make for the final project. Can I get some ideas for the final project?
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 ...
1
vote
1answer
88 views

bot50 invitation on me50

I found an email on my inbox saying "@bot50 has invited you to collaborate on the me50/MyGithubUsername repository" and I accepted the invitation. Is that something malicious?
0
votes
1answer
51 views

CS50 pset4 recover.c produces unsupported jpg images

Here is my code. Please help. #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <stdbool.h> #define BLOCK_SIZE 512 #define FILE_NAME_SIZE 8 typedef uint8_t ...
0
votes
2answers
166 views

PSET 4 Errors: where did I go wrong?

So after being stuck on this pset for overlooking tiny typos I have finally gotten it to compile but I received more errors then I would like to have. If anyone could tell me where I can find the ...
0
votes
1answer
10 views

it is about credit in pset 1 code (no error but doesn't work) it doesnt show amex or visa or mastercard just keeps prompting to enter again

#include<cs50.h> #include<stdio.h> int main(void) { long cc, wcc, d = 1; int sum = 0, n = 0, fd ,ftd; do { cc = get_long(" number : "); } while ( n < 0 ); ...
0
votes
2answers
53 views

PSET 1 Cash two inputs don't get appropriate value

I'm stuck trying to understand what's wrong with my code... When I check it I get this error message: :( input of 1.6 yields output of 7 expected exit code 0, not 1 But getting 7 coins for 1.6$ ...
0
votes
1answer
302 views

Problem Set 8 / Web Track - Finance (Redirect Error)

My functions seens to work fine, but when i have that redirect the user to the homepage (redirect("/")) the application crash and show the error message: 500 internal server error and I don't know if ...
0
votes
1answer
220 views

CS50 Blur issue

void blur(int height, int width, RGBTRIPLE image[height][width]) { RGBTRIPLE holder[height][width]; int red; int green; int blue; float counter; for (int i = 0; i < height; i++) { for (int j ...
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
2answers
75 views

Pset1 Cash (in C) array increment error

Context; I'm trying to solve Cash by; Taking positive integer user input, saves as float "ch" for change. (this as an implementation detail) Create an array "coin_val" with coin value by descending ...
0
votes
1answer
667 views

pset3 Runoff help

My code compiles but the only functions that had no errors are the print_winner and eliminate functions. I have tried to solve the errors for the other functions with no luck. My errors with the ...
0
votes
0answers
18 views

Audit access of course

I audited this course on edx two weeks ago. There is no notification about expiration date of my audit access. Why? Is it available for me till the course ending date?
0
votes
1answer
136 views

Getting this error: invalid operands to binary expression ('int' and 'int (int)') in the below code on ps1 cash.c

#include <cs50.h> #include <stdio.h> #include <math.h> int biggestCoin (int num); int main (void){ float userinput; int changeOwed, coins; do { userinput = ...
0
votes
0answers
486 views

PSET6 DNA [SPOILER]

during solving the dna problem i had a hard time trying to work out the large database " the small one work just fine" anyway i reached to this abstract solution to get "scores" of the sample dna so ...
0
votes
1answer
194 views

Problem Set 4 - Filter (Blur)

I know its pretty lame and uninspired to hard-code each and every special case of the blur function, but somehow it still refuses to pass most of check50's tests (aside from the middle and edge pixel ...
0
votes
1answer
34 views

2019-2020 Progression bar red beside finished

I've start the CS50 late 2019 and finish it last week. I'm in this case: "If you submitted Problem Sets 0 – 4 last year, resume your studies with Problem Set 3 in Week 3 then skip to Week 6 and ...
0
votes
1answer
233 views

Pset4 filter reverse issue

I am banging my head for the past hour on why this does not work. Basically, testing on the provided pictures, my reverse function does what it says on the tin. However, when I test it vs check50, ...
0
votes
1answer
64 views

PSET2 Caesar isdigit function works opposite way

I am currently at CS50x2020 PSET 2 Caesar "validating the key" and having issue with using the isdigit function. From what I understand from the programmer's manual, isdigit will return 0 if the input ...