All Questions

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

bool function - Plurality.c - PSET3

I am trying to match the vote and candidate name with the following code: bool vote(string name) { for (int i = 0; i < candidate_count; i++) { if (strcmp(name, candidates[i].name) != 0) ...
0
votes
1answer
9 views

Counting words pset2 Readability

there. I am trying to complete pset2 Readability and have a doubt on counting words. Can this be an approach? int words = 0; for (int i = 0; i< n; i++) { if (isblank(text[i])) { ...
0
votes
1answer
6 views

Segmentation fault pset4 recover

I'm having a segmentation fault which I'm not being able to identify. After reading about other similar problems I thought it could be that I wasn't checking if (img == NULL) but even after adding it ...
0
votes
0answers
6 views

Pset6 DNA check STR against DNA file

I wrote some code, let it sit for a few days, and now I've come back and confused myself. It looks like the problem is in the line comparing the STR to the DNA text file. I've been tweaking it, but ...
0
votes
1answer
7 views

CS50_2020 Pset 4 Filter Reflect

I'm currently working on the reflect function, I'm going to include my code below [removed] What problem are you having? Describe the problem in detail. If appropriate, include any error messages, ...
0
votes
1answer
16 views

pset3 (runoff) check50 is giving an error for print_winner

I can't find what's wrong with my code but check50 keeps telling me :( print_winner prints name when someone has a majority print_winner did not print winner of election :( print_winner returns ...
0
votes
0answers
7 views

FINANCE [UNIQUE constraint failed: users.username] Error encountered using check50

I have finally got my entire program working for PSET8 Finance. I receive no errors in my dev console and all functions are working correctly after registering 15 users. For some reason, though I get ...
0
votes
1answer
11 views

Week 8 web track Code replication problem

So I am trying to replicate the code done in Flask lecture video, which still revolves around submitting and inputting a user's name. I think I have done the exact same code as Brian's, but the code ...
0
votes
1answer
26 views

pset7 movies Q12

I'm stuck in PSET7 SQL part 1 question 12: I want to list all movies with 2 people inside. The JOIN of the 3 table is set, the problem is in my WHERE statement: WHERE people.name = 'Johnny Depp' ...
0
votes
1answer
10 views

Error testing in plurality question

I already test my code with all possible input and it working fine but when I run with check50 cs50/problems/2020/x/plurality, I got a couple of error result :( print_winner identifies Bob as ...
0
votes
1answer
11 views

Pset7 Houses Issue

I thought I had this one figured out, but check50 disagrees. The specification suggests that the output needs to be formatted as "Harry James Potter, born 1980 or Luna Lovegood, born 1981." To ...
0
votes
0answers
12 views

Pset8 showing code on webpage instead of proper format

I am working on PSet8 and I have this problem now: I can successfully logged in the app, but I landed on the index page that looks like the snapshot below, instead of proper formatting and css style ...
0
votes
1answer
26 views

Pset 5 Speller recursive unload

I've tried implementing a recursive function to free every node in each linked list in the hash table but it turns out it doesn't seem to free any memory as Valgrind shows there is a leak when calling ...
0
votes
1answer
46 views

Pset 5 Speller Linked List Nodes

I thought I got pointers but I don't fully understand a function that gets a new node for a linked list. I understand the theory behind Hash tables and chaining with linked lists but when it comes to ...
0
votes
1answer
11 views

Plurality - check50 issue

Hoping for some insight on this.. code works perfectly fine, prints correctly when testing in terminal, but for some reason check50 outputs errors once it starts printing winners. Would love to find ...
0
votes
0answers
16 views

Pset 8 finance buy internal server error

I am doing PSet 8's finance and am stuck in the buy section because of an error message produced by this code: # Store user's cash balance share_counts = int(request.form.get("shares")) db.execute("...
0
votes
1answer
12 views

How to locate the project assignments for CS50's Mobile App Development with React Native?

I enrolled in the course CS50's Mobile App Development with React Native a couple of days ago (1/21/20). At the end of the 3rd lecture video, Jordan mentioned the first project assignment, and also, ...
0
votes
1answer
16 views

Carryover from 2019 to 2020 not working for me

I had successfully completed Psets 0-8 in CS50x 2019. But I wasn't able to finish my final project before 2020. So now I'm carrying forward as mentioned in the website, screenshot below I had written ...
0
votes
1answer
11 views

Caesar Working as Expected - Check50 glitched?

So my Caesar is finally working and working as expected but after submitting it check50 is not giving me score for it
0
votes
2answers
18 views

Pset 5: Speller, check or load issue

It seems that Speller has tripped up many people. I searched through previously-asked questions but either it wasn't my problem or I had trouble understanding how I could implement the answers in my ...
0
votes
1answer
11 views

PSTET 4 - Reflect

I am currently working on the pset4 , specifically the filter functions. I keep getting the error that -1 is out of bound of the array, but i went over the code multiple times and use debug50 to trace ...
0
votes
1answer
29 views

pset4 filter: blur seems to be working, but check50 reads errors

For the filter program on pset4, the blur filter seems to be working fine for all images that were included in the distribution code. The blur filter takes a pixel in an image and adds its color ...
0
votes
1answer
63 views

PSET6 - DNA - Code fails to compare STRs to DNA text file

I have updated my code after making a number of amendments but am still a bit stuck! I don't think my STR_check_count is working properly as it always seems to return 0s and I'm also not sure if I'm ...
0
votes
1answer
24 views

pset4 filter: reflect produces “UndefinedBehaviorSanitizer:DEADLYSIGNAL” forever

When I filter to reflect an image, it keeps printing the following without stopping: UndefinedBehaviorSanitizer:DEADLYSIGNAL UndefinedBehaviorSanitizer:DEADLYSIGNAL UndefinedBehaviorSanitizer:...
0
votes
1answer
22 views

Final project question and Hardware for a SQL server

Hello Dear Coders, I'm in charge of a radiology center (Xray imaging) and we need a cross server system to get patient datas with images. For the CS50 final exam I wish to build a "test" server for ...
0
votes
1answer
43 views

PS2 Caesar Algorithm

#include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> #include <stdlib.h> int main (int argc, string argv[]) { //Terminates if Command-line ...
0
votes
1answer
77 views

PSET 3 runoff record preference problem

I am going through the problem set 3 and I am currently stuck at the record preference (vote) function. I have built a code down as below, but running it gives me a segmentation fault error message. ...
0
votes
1answer
16 views

Why does it say that my index it -1?

I am working on blur in filter and it says my index is our if bound -1 // Create count starts and end count int sh = -1; int eh = 1; int sw = -1; int ew = 1; ...
0
votes
1answer
31 views

Readability wrong grade

I am right with other string but this one=> Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book ...
0
votes
1answer
10 views

credit - Why this AMEX and MASTERCARD numbers are considered invalid?

I have compiled my version of credit, anyway check50 throws 2 fails during its check. Lines with numbers where it fails are: :( identifies 369421438430814 as INVALID expected "INVALID\n", not ...
0
votes
0answers
26 views

PSET8 CS50 Finance: /Check fails to run, does not catch or notify of duplicate usernames

I have been struggling with the check function in PSET8 for a few weeks now, and have run into various problems as I tried to work through my issues. Currently, it seems by check .get function does ...
0
votes
1answer
14 views

Why am I keep getting a segmentation fault in my code for speller every time I run it?

According to valgrind, it says lines 40 and 87 are creating this error. // Implements a dictionary's functionality #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #...
0
votes
1answer
39 views

Why does it not round up correctly?

So i'm doing filter and I noticed that its not rounding up correctly. // Convert image to grayscale void grayscale(int height, int width, RGBTRIPLE image[height][width]) { // Iterate over height ...
0
votes
1answer
23 views

does not produce the correct voter count when multiple voters are eliminates?

My could does not produce the correct voter count when multiple voters are eliminates. // Tabulate votes for non-eliminated candidates void tabulate(void) { int j = 0; // Iterate over voters ...
0
votes
1answer
8 views

speller not outputting the right number of misspelled words

i think the problem is with my check function. https://pastebin.com/S7Sqq1Jj when i test it with cats.txt,i get: WORDS MISSPELLED: 6 WORDS IN DICTIONARY: 143091 WORDS IN TEXT: 6 TIME IN ...
0
votes
1answer
43 views

Problem set 3 Plurality ISSUE cs50

I've been trying to solve the new problem set 3 plurality step by step, and here where I got stuck, but somehow I'm sure about my answer bool vote(string name) { bool v = false for (int i = 0 ; i &...
0
votes
1answer
73 views

Why does runoff not stop running?

So when I run my code it does not stop running ~/pset3/runoff/ $ ./runoff mike john Number of voters: 3 Rank 1: john Rank 2: mike Rank 1: john Rank 2: mike Rank 1: mike Rank 2: ...
0
votes
1answer
23 views

How to set rank for all preferences?

Any thoughts on that to set rank for all preferences?
0
votes
1answer
41 views

pset3 runoff segmentation fault problem

I am doing the 2020 version of CS50's pset3 and I am already stuck (again) at the runoff voter function. My code below resulted in segmentation fault. I don't know how to fix this though. So here's ...
0
votes
1answer
36 views

Pset4: Filter, reflect values are off

The code seems to spit out a nice-looking reflected image, however, check50 says some of the values are not reflecting the way they should be. It's odd because it works for a 1x3 image and 3x3 image, ...
0
votes
1answer
8 views

cs50 pset2: check50 does not accept output

I am running check50 but it will not accept my output as correct. For example, one of the conditions needed to be satisfied is: When I run the code below I obtain the desired output (CAQGON) but ...
0
votes
1answer
31 views

Pset4: Filter, Sepia, everything is fine except light blue

I have managed to get the sepia filter to work - almost. At first I was getting bright pink/magenta in the areas that were supposed to be white. I managed to fix that, but now I am left with some ...
0
votes
0answers
13 views

trie speller always leaves last word out for check()

My check function seems to find all incorrect words except the last work in the text. I've tried to move around my is_word==true statement to check if its because I'm not checking that the word ...
0
votes
1answer
15 views

Problem Set 1 (Credit) - More Comfortable - 'Else' Block Not Running

I attempted Problem Set 1's 'More Comfortable' Credit assignment today, which is essentially to implement Luhn's mod 10 algorithm for checking that a given debit/credit card number is valid. I've ...
0
votes
1answer
58 views

PSET6 DNA Sumbit50 not matching with usual output

Hello, After a lots of effort I was finally able to implement DNA and it works correctly ! but Submit50 shows correct output for text file (1-5) but incorrect for rest The text file which have ...
0
votes
2answers
16 views

Why does this error keeps popping in my caesar code?

I am doing the caesar exercise for PSET 2 and this is my code: #include <stdio.h> #include <cs50.h> #include <stdlib.h> #include <ctype.h> #include <string.h> int main(...
0
votes
1answer
58 views

PSET6 DNA How to read each value in the CSV file?

In PSET6 DNA, I have to read the CSV file. I use with open("P:\Code\Python\dna\databases\small.csv") as csvfile: #open on my PC dna_db = csv.DictReader(csvfile) for row in dna_db: ...
0
votes
1answer
40 views

Plurality fails to compiles

I always work on Psets on my local machine and replace string with char * so I don't have to use the CS50 library in my header files. This is the only explanation I have for why my code doesn't ...
0
votes
0answers
35 views

pset6 (readability) score just 31% upon submitting eventhough program outputs are fine

My readability program seems to work perfectly and since the output matches all of the outputs for the given inputs in the problem specification. However, when I submit my program, I only receive 31%. ...
0
votes
1answer
9 views

Cs50 Pset 1 Cash

I am getting the desired number of cents however when I am submitting I am getting the below error :(. I tried to do some research but still not able to find the fault. Please check. Thank you!. :( ...

15 30 50 per page