All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
3 views

Can't compile readability in cs50 IDE

I'm trying to do the readability exercise for week 2 in the cs50 IDE and am unable to compile my program. I followed the steps below exactly, but am getting the error message depicted below the steps ...
0
votes
0answers
2 views

i am working on problem set1 Cash. “else if” is not working

everything is working fine until the condition of remainder <= 5 is met (else if) then it just executes the first part only (if). include include include int main(void) { float n; do { ...
0
votes
1answer
4 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
1answer
12 views

How to get my code to print the right letter count?

I wrote some code to print out the required number of letters inputted into a given text. For some reason after 9 letters it seems to increment by one and will slightly overshoot the number of letters ...
0
votes
1answer
9 views

Pset Cash CS 50 - need help

It compiles without any problems, but when I try to execute it, the Terminal crashes. Do I get in some infinite loops here? I would appreciate some help - thanks a lot! #include <cs50.h> #...
0
votes
1answer
21 views

Pset4: Recover, only 49 images and fails with check50

I recently started with CS50 and I struggle a bit with pset4's recover. While the jpgs look correct to me, my code only recovers 49 jpgs total, not the 50 which are expected. Check50 fails on the ...
1
vote
0answers
13 views

Pset 3 Plurality - Error: linker command failed with exit code 1 (use -v to see invocation)

I have come across an unusual situation and I was not able to find a solution on this elsewhere. So for some reason, I was having issue compiling my plurality assignment and it kept on giving me the ...
0
votes
1answer
15 views

PSET 3 Runoff. Noob questions

Can anyone explain to me the following codes? The first set of code calls vote function and prints invalid when vote is invalid. But what are the values of i and j here? :/ As for the second line of ...
0
votes
1answer
13 views

Filter - Blur Function Correct?

My blur function looks like it is working when I output files and it passes check50 on everything except the last two checks. Looking at the message below, it appears my values are correct ( "70 85 95)...
0
votes
0answers
13 views

Assignment 0 paddle not moving

In Assignment 0 for Game Development, I have programmed the left paddle to move to they Y-position that the ball is going to go to. Unfortunately, the paddle is not moving at all, almost as if I have ...
0
votes
1answer
16 views

pset 4 - recover, almost done! images opens correctly but check 50 doesn´t recognize it

My programs seems to work nicely,i can even see the images, i just don´t get what´s going on with Check50, must be a tiny detail. Thank you. Here is check50 : https://submit.cs50.io/check50/...
0
votes
1answer
11 views

How to test pset7 queries in the terminal window?

I am trying to test the queries I've saved in files i.e. 1.sql, 2.sql,.... But I can't able to test them in the terminal window. The command given in the instruction is not showing any results. ...
0
votes
1answer
12 views

Question for Array in C (with function e.g. set_array)

While I was doing cs50 week2. I found something hard to understand. #include<stdio.h> void set_array(int array[4]); void set_int(int x); int main(void) { int a = 10; int b[2]; ...
0
votes
0answers
20 views

pset3 Tideman: function to print out preferences array is not working

I have written a function, print2d(), to print out a 2D array. I am using it to print out the preferences array after calling record_preferences() in main according to the provided template. The ...
0
votes
1answer
10 views

Second pyramid in mario, how to put that onto the same line as first pyramid

What should I do to join the two pyramids onto the same line? Output is: Height: 8 # ## ### #### ##### ###### ####### ######## # ## ### #### ##### ###### ####### ####...
0
votes
1answer
16 views

Help with pset5 'recover': incomplete jpgs

I´ve been working on recover for the past few days and I am having some trouble getting a working solution. The code below prints out 49 jpgs instead of 50, and they are all incomplete or very blurry. ...
0
votes
1answer
6 views

Resize Less - failing to resize small.bmp

Hi guys I've scratched my head about this for a week now and I'm struggling to see what the issue is. The smiley.bmp file seems to be resizing correctly but not the others. Can anyone offer some ...
0
votes
1answer
14 views

CS50 pset 1 cash problem: keep getting 1 as answer

I'm trying to do the CS50 cash problem and the answer keeps getting number 1 no matter which change I input. It won't accept negative numbers as asked by the problem, but I don't know why it doesn't ...
0
votes
1answer
27 views

Problem Set 5 - Speller (Load and Check function) segfaults

I have a somewhat okay understanding on how linked lists worked since I've had some experience working with them in high school. However, I keep running into these pesky segfaults and I have no idea ...
0
votes
1answer
5 views

PSET 1 - Where I have to make my answer to Mario PSET?

I am starting to write my code for Mario but I am lost. Where do I have to write it in the MarioCS50 LAB, or I have to create a new Sandbox? Thanks!
0
votes
1answer
13 views

What is the deadline of CS50's Introduction to Computer Science course 2020?

I started CS50's Introduction to Computer Science course 26th of March 2020. I have not a clear idea about assignment deadlines and course end date. I want to take the official certificate after ...
1
vote
0answers
6 views

Why doesn't IDE50 highlight the “IN” keyword in SQL?

Highlighting works well with all other keywords I tried, this is confusing to people who might think (like me, originally) that the keyword is wrong/inexistent...
0
votes
1answer
14 views

PSET3-Plurality. Check50 doesn't re

After finishing plurality, it fails check50. It returns "print_winner function did not print winner of election". In print_winner function I did the following void print_winner(void) { //create a ...
0
votes
1answer
20 views

pset1 cash: greedy algorithm coin change round off

The output is not being rounded off: It doesn't count the cents value if you input a dollar in decimal. if it's $45.67, it only counts change for $45. Also, output comes back 0 if the input is ...
0
votes
1answer
9 views

CS50 Recover outputs random symbols instead of JPEGS

I am working on pset4 recover in CS50 and I think I am almost done it. The files that it outputs though appear as a bunch of random symbols instead of a jpeg, I'm not sure why this is occurring but ...
0
votes
1answer
12 views

Mario Less Loops doubt and code review

I have attempted the PSET 1 of 2020 CS50x and have a couple of doubts. Could someone check if the following code for Mario less one is correct. If it is I also had a question that what should I put ...
0
votes
0answers
6 views

plugins = u._instantiate_plugins(kwargs) AttributeError: 'NoneType' object has no attribute '_instantiate_plugins'

import os from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session, sessionmaker engine = create_engine(os.getenv("DATABASE_URL")) db = scoped_session(sessionmaker(bind=engine))...
0
votes
1answer
15 views

pset3 I did print winner from pluarity, but check50 says I didn't. What's wrong?

I ran plurality according to spec and was able to print out all winners correctly. check50 says I didn't. What could be the problem? Is there any way to see what check50 used as inputs for plurality? ...
0
votes
0answers
14 views

Trying to launch a website for project, and runserver command will not work :'(

I'm having trouble with python manage.py runserver in mac terminal. That command gives the following error: ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding' (/...
0
votes
1answer
8 views

During PSET 2: Substitution, I got an expected expression error for get_string. Please help

substitution.c:24:23: error: expected expression char* plaintext = get_string(); ^ /usr/include/cs50.h:109:53: note: expanded from macro 'get_string' define get_string(...) ...
0
votes
0answers
11 views

CS50 Web Programming: Lecture 3 (SQL)- import.py won't work for me

I'm trying to run the same code for import.py from the lecture, but am running into trouble. import.py: import csv import os from sqlalchemy import create_engine from sqlalchemy.orm import ...
0
votes
0answers
23 views

SQL error pset7 houses

with open(argv[1],"r") as inp: reader = csv.DictReader(inp) for row in reader: lis = row["name"].split() print(len(lis)) if (len(lis) == 2): print(row["...
0
votes
1answer
15 views

Pset 2 - Substitution - Error - handles multiple duplicate characters in key

I have finished the substitution pset2 problem, however, there was one error when I submitted my assignment. The description of this error was handles multiple duplicate characters in key. timed out ...
1
vote
1answer
28 views

PSET2 Substitution - Output seemingly correct, fails check50 (null character?)

thank you for your help in advance! I can't wrap my head around what's wrong with my code as the output is (seemingly) correct. I suspect it has something to do with the null character. #include <...
0
votes
0answers
30 views

Pset 3 Runnoff - Can't find the error

All, I have checked this every which way and can't figure out what I am doing wrong. If there is an outright winner ( candidate vote total > 50%) in the first round it works. In every other scenario ...
0
votes
1answer
20 views

Pset7 8.sql is not giving output

i am in problem set 7 now, and i'm stuck in '8.sql'. Specifications is to write a SQL query to list the names of all people who starred in Toy Story. When i run my code, i get no output, i have ...
0
votes
1answer
13 views

Why is the value 16,432 appearing, and why is it getting reduced each time I run the program?

So I was following along the week one lecture, and I was trying to replicate the average-taking program, when I made a slightly silly mistake- I used the average function within the for loop. #...
0
votes
1answer
28 views

pset4 blur filter

I've been working for like a week on cs50/pset/filter/blur question, but this doesn't seem to be working. My code is like this, and the resulting "blur filtered" image is not any close to what is ...
0
votes
0answers
29 views

PSET3 -Tideman - lock_pairs

I'm doing tideman and I can't understand where is the problem: my code seems to be working but the test says that it does not. I will share a bit of my code: int count = 1 void lock_pairs(void) { ...
0
votes
1answer
5 views

How to stop terminal process in CS50 Sandbox? (I've tried Ctrl-C and Ctrl-\)

I'm doing problem set 1 on the CS50 Sandbox, and have ran into some infinitely running programs. When I do ctrl-c or ctrl-\ (I am on mac and have tried both cmd and ctrl), the process still continues ...
0
votes
0answers
62 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
0answers
18 views

Week 1 Super Mario Level 2

All, I have Mario built if I input numbers 1-8. However I can't get it to run a second time or re-run if I put in a number like 9. I think I need to have a loop to return it to the top. Have tried ...
0
votes
1answer
27 views

PSET 4- RECOVER getting 22 pictures and none good

I keep looking my code and connot identify what is going on. I open 22 pictures, but none of them are good. It doesn't even write in the entire picture, some of them just a part of the picture is ...
0
votes
1answer
8 views

How does memory work with pointers and custom data structures

I am doing pset 3 tideman. For this I first implemented mergesort recursively. Then, to adjust it to the problem, I introduced a new part of the pair data structure, margin, and adjusted my mergesort ...
0
votes
1answer
12 views

pset 4 : filter - Could not open .bmp file

I have a trivial question. Starting the pset with freshly downloaded and unchanged code and trying to pass a file with ./filter -g yard.bmp out.bmp yields : Could not open yard.bmp. I wrote a simple ...
0
votes
1answer
11 views

Week 1 - Hello (I do not have place to write the code)

sorry I am little bit lost, Where I have to complete the Hello Task? in the cs50 sandbox? thanks! because in the c sandbox, I do not have the part where I write my code, just the terminal. Thanks!
0
votes
1answer
37 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
15 views

Pointer Initialization and Free, Help!

If you initialize a pointer (trav) and assign it another pointer, should you and what happens if you free trav? thank you! node *table[N] = { NULL }; trav = table[i]; Also, should malloc be called ...
0
votes
1answer
8 views

CS50 2018 Lecture 1C. Unable to figure out syntax error in code

My code : #include <stdio.h> #include <cs50.h> int get_positive_int(string prompt); int main(void) { int i = get_positive_int("Positive interegr: "); printf("%i\n", i); } int ...
0
votes
1answer
48 views

cs50 pset 6 DNA. How to compare my results with the databse to print out the answer?

I got to a point in this problem where my code was working alright for the small csv, but it was clumsy and repetitive, so I tried to make it more elegant by making more complicated nested loops to ...

15 30 50 per page
1
2 3 4 5
212