Questions tagged [cs50x]

The tag has no usage guidance.

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

My CS50 PSET4 Filter (Less) Blur function doesn't pass check50 despite seemingly working fine

I've been working on CS50 PSET4 Filter (Less) and finally got a working blur function (or so I thought!) // Blur image void blur(int height, int width, RGBTRIPLE image[height][width]) { RGBTRIPLE ...
0
votes
1answer
15 views

Pset4 Filter edges - seems to work but does not get approved

The output looks correct. I manually calculated the values for one single pixel and printed out the calculated values in the function using printf() and the values were almost the same, with a slight ...
0
votes
0answers
13 views

NameError in Pset: Finance

Cause application raised an exception (see the log for more details) Log sending POST request to /login sending POST request to /buy exception raised in application: NameError: name 'stock' is not ...
0
votes
1answer
21 views

I believe my code is right but it's not giving output and pops segmentation fault

This is my code for Caesar Pset2. The code must be doing right but it's broken somehow. #include <stdio.h> #include <math.h> #include <string.h> #include <ctype.h> #include <...
0
votes
0answers
11 views

CS50 Finance Error: Expected something but got other

I'm struggling with register function in application.py since I am having error messages in check50 That says: :) register page has all required elements :( registering user succeeds expected ...
0
votes
0answers
15 views

CS50 Week9 Finance I have an error in register

I'm struggling with register function in application.py since I am having error messages in check50 That says: :) register page has all required elements :( registering user succeeds expected ...
0
votes
0answers
19 views

How to sort an array of strengt by victory using bubble sort (pset3: Tideman)

I wrote this code... void bubbleSort(void) { // loop to access each array element for (int step = 0; step < pair_count - 1; ++step) { // loop to compare array elements for (int i = 0; i < ...
0
votes
1answer
21 views

How does csv.DictReader know what to call the keys in the dictionaries it creates?

In Lab 6 - world cup - you are given a csv file with two columns of values. When reading that file, many solutions I found use csv.DictReader to read each row of the csv file as a dictionary. They go ...
1
vote
1answer
17 views

Mario problem: Program got stuck at user input

// ** Below is the code of mario pset1, its taking input of width multiple times and not executing step after input// #include <cs50.h> #include <stdio.h> #include <math.h> int main(...
0
votes
1answer
19 views

How can I change my certificate name?

I have finished the course in the past month and noticed there were a typo on the certificate name. Is there any way to fix that? Where is CS50 picking my name?
0
votes
1answer
10 views

CS50 ide. Not being being able to compile program

Whenever i try to compile the program in the cs50 ide this error shows up- make: *** No rule to make target 'string'. Stop. Can someone please help me out. Thanks!
0
votes
0answers
10 views

error: address of stack memory associated with local variable

I have the following function: string encipher( string plaintext, string key) { int size = strlen(plaintext); char ciphertext[size]; // For each alphabetic charaters determine what letter ...
0
votes
0answers
22 views

Why do Escape Sequences in C work differently when I compile code by using GCC?

Why do Escape Sequences in C work differently when I compile code by using GCC? For example, Input: #include <stdio.h> int main(void){ printf("Hello world\n"); } Output in CS50 ...
0
votes
0answers
26 views

Pset9 problem at check50 tests

hello, i've tried "112.00" in my solution and cs50's solution and the result is same "invalid shares" but i don't know why this error occur. i'm really stuck any help please
0
votes
1answer
24 views

Unable to complie PSET3

I tired compiling my code, many time but it shows :( tideman compiles code failed to compile. Can anyone take a look. Another thing that i want to ask is my code well written? Because i feel it's too ...
0
votes
0answers
22 views

CS50X Finance: check50 says buy isn't handling valid purchase. But it is handling fine

I'm wondering what is being tested because its looking for the value 112. expected to find "112.00" in page, but it wasn't found I'm flashing the result of the buy transaction on the index....
0
votes
1answer
17 views

PSET4/Recover -- Why am I getting "double free or corruption (top)"?

#include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int counter = 0; char filename[8]; FILE *img; BYTE buffer[512]; int main(int argc, char *argv[])...
0
votes
1answer
32 views

What mistake am I doing in the below "buy" and "sell" code.? I get the below errors from check50

I get the below error from check50: :( buy handles invalid ticker symbol application raised an exception (see the log for more details) :( buy handles fractional, negative, and non-numeric shares ...
0
votes
1answer
21 views

Not sure why code isn't working: PSet4 Filter (less) - Blur

I'm not sure why my code doesn't work for the blur section of pset4 (filter; less)? (I am aware there's a more efficient way to do this, but am interested in learning what's wrong with this specific ...
0
votes
1answer
9 views

error : function definition not allowed here pls help

i got this error message pls help $ make triangle clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow triangle.c -lcrypt -lcs50 -...
0
votes
1answer
13 views

pset2//caesar : strspn result

I'm struggling to understand : (argc != 2 || argv[1][strspn(argv[1], "1234567890")]) It works, but I'm trying to understand what's going on inside the if evaluation, and the value argv[1][...
0
votes
1answer
35 views

CS50 Finance index doesn't display what it needs to

I'm at the last check for the 'buy' part and I keep getting: :( buy handles valid purchase expected to find "9,888.00" in page, but it wasn't found I'm pretty sure that number is supposed to ...
0
votes
1answer
47 views

CS50 blur filter failed 3x3 and 4x4

I created a for loop checking each pixel around the one to be blurred. If the pixel was in range, its RGB values would be added to a total variable to then be averaged. My program works for all ...
0
votes
0answers
59 views

Unable to figure out if my submission on scratch project is completed or not?

I want to submit my scratch project. I have recieved a invite mail by bot50.In which there was a "view invitation" button ,which when clicked on ,redirects me to my github. Now as per ...
0
votes
1answer
42 views

(!vote) in runoff [pset3]

I am having real difficulty understanding how calling the vote function for valid votes in runoff is supposed to work. The relevant part of the distribution code is as follows: // Record vote, unless ...
0
votes
1answer
53 views

Pset3 - runoff - print_winner and find_min error

After I checked my code using check50 cs50/problems/2021/x/runoff, I received the following error messages for my bool print_winner(void) function and int find_min(void) function as follows :( ...
0
votes
1answer
35 views

Segmentation Fault for PSet1 Credit in CS50

first time posting. I swear I looked for answers in other segmentation fault questions already, but I am new to programming and to troubleshooting/researching effectively. My PSet1 program "...
0
votes
1answer
21 views

Is argv[] changing my input?

I'm having trouble running my program, so I tried to look at it in debugger program. Is this screenshot telling me that argv1, shown on the right as **argv, is being recorded at a '.', and not the ...
0
votes
1answer
20 views

Why does my code count a '.' only at the end of a multi-word string, but not at the end of a single word string?

I don't want my code to count non-alphabetic characters. It doesn't if they are alone, or at the end of a single word string. Why does it count an extra character at the end of a multi-word string or ...
0
votes
1answer
33 views

PSET4 Recover - Cannot identify the error in my program

I'm currently trying out CS50's Recover (PSET4). The program compiles but the only output I get when I run it is 000.jpg; That too I can't open because the image isn't correctly returned and I get an &...
0
votes
1answer
35 views

How do I change if/else if statements into a loop?

I cannot figure out how to change the following code into a loop. This is just a portion of a larger code where n is defined by user input. How do I create a loop that adds one "#" to each ...
0
votes
1answer
19 views

Git hub on Chromebook

So, I've been doin Harvard's intro to computer science I passed week 0 an was pretty much done with week 1 when it said I couldn't run check 50 cause I hadn't authorized it. It gave me a link but I ...
0
votes
0answers
33 views

Getting a segmentation fault on cs50's filter

I'm currently stuck on cs50's pset4 filter (less comfortable). The program compiles perfectly. I have tried out the first three parts of the code (grayscale, sepia & reflection) and their output ...
0
votes
1answer
7 views

Why is my C modulo code giving repeating identical output?

I am wondering why my output repeats before it gets to the final output: #include <cs50.h> #include <stdio.h> #include <math.h> int main(void) { long bignum = 4300123488893756; ...
0
votes
1answer
22 views

CS50 Final Project Help: SQL QUERY...inserting row from one table into another table after button pressed

I have nearly finished the Cs50x course but I am stuck on my final project. I am creating a website called 'Letterbooks' (inspired by Letterboxd) that allows you to log books that you have read. I am ...
0
votes
1answer
39 views

Indexing problem

when debugging, the inner-most if condition never entered. Whether the char is upper-text or lower text. I 'm using the same methodology in both cases. // testing if the char upper text if ...
0
votes
1answer
31 views

CS50 - PSET 4 - Filter - Edges

//Pixel buffer RGBTRIPLE pixelBuffer[height][width]; //Iterates on every pixel and calculates Gx and Gy for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++)...
0
votes
1answer
54 views

Week 2 Lab (Scrabble)

This is my code: #include <ctype.h> #include <cs50.h> #include <stdio.h> #include <string.h> // Points assigned to each letter of the alphabet int POINTS[] = {1, 3, 3, 2, 1, 4,...
0
votes
0answers
9 views

How can I receive a string from the user to tokenize without having to initialize the array with a constant?

The string in question is names1[] that is initialized with "Anya Ava Sam Mark" int main() { char names1[] = "Anya Ava Sam Mack"; char delim[] = " "; ...
0
votes
0answers
6 views

Error with calculating Egdes in Pset4 Filter (More) Detect Edge problem

// Detect edges RGBTRIPLE new_pixel(int i, int j, int height, int width, RGBTRIPLE image[height][width]) { int redx; int bluex; int greenx; int redy; int bluey; int greeny; ...
0
votes
0answers
35 views

Pset4 - Filter - Blur- some pixels have RGB 0 0 0

I've been struggling with the filter portion of problem set 4 for quite a while. In particular, I've had a particularly persistent bug. As you can see from the Check50 screenshot below, some RGB ...
0
votes
1answer
38 views

Trivia | Uncaught TypeError: correct.addEventListner is not a function

Inside the script tag there was a error: Uncaught TypeError: correct.addEventListner is not a function at HTMLDocument. (index.html:14) Please help me fix it here's the code: var correct = document....
0
votes
1answer
27 views

I have to enter any letter to get the result

I am currently doing the problem set 1 credit in cs50 program. I managed to write the code. It's compiles fine however once I enter the credit card number it stops, i must type any letter to get the ...
0
votes
2answers
73 views

Pset4 Blur (filter less) not passing check50

As title says, I am not passing check50 for blur. I am aware that my method is probably extremely tedious and not the best method, but I came up with it myself and would like to find out why it isn't ...
0
votes
1answer
49 views

pset4 - (Filter Less ) - Doubts with malloc()

I'm performing the problem set from pset4 to the (filter less) part. I wish to use malloc() to my advantage to speed up image filtering and maybe check50 will accept my solution to the problem. I ...
1
vote
1answer
46 views

Recover - segmentation fault and other general problems

Hey guys so I've hit a bit of a wall with Recover, when I run my program I get segmentation fault but I also don't know how to end off one jpeg when another header pops up? In essence, I'm not sure ...
0
votes
1answer
27 views

Not able to link cs50x with Edx

I'm new here. I just started the Edx cs50 course and submitted the first problem. When I go to https://cs50.me/cs50x I get to see the following error: Your CS50.me account is not yet linked with edX. ...
0
votes
1answer
126 views

Lab 5 Check50 Error Question

When I run Check50 I get an error. I have watched the hint video and my code matches what is shown. I have attached a screenshot of my error as well as the code below. Thank you for the help! person *...
0
votes
1answer
24 views

PSET 8 Finance ":( buy handles valid purchase exception raised in application: TypeError: 'method' object is not subscriptable"

I've been having a problem with CHECK50, I cant seem to find the right object to change. This is the log I get sending GET request to /signin sending POST request to /login sending POST request to /...
0
votes
1answer
120 views

API key or look up function error in cs50 finance pset9?

I was working on the implementation of buy and trying to buy stocks when all of a sudden I began receiveing incorrect/invalid stock symbol for every stock symbol I tried(as if the stock symbol was not ...

1
2 3 4 5
17