Questions tagged [pset3plurality]

The tag has no usage guidance.

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

Plurality print_winner function gives one error

This is my print_winner function void print_winner(void) { int winner_vote; for (int i = 0; i < candidate_count; i++) { for(int j = i + 1; j < candidate_count; j++) {...
0
votes
1answer
217 views

cs50 plurality non-void function does not return a value in all control paths error

I'm currently trying to do cs50 pset3 plurality problem and I have unfortunately ran into this error which I do not know how to overcome. The error is "non-void function does not return a value ...
0
votes
1answer
25 views

Check50 doesnt approve but code seems to work fine

PSET3 Plurality: Although the problem itself isn't tough to solve but Check50 simply doesn't like the way I wrote it. I've been trying to pass the tests since an hour or more but I can't figure out ...
-1
votes
1answer
33 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
12 views

How do you make a rule for the target?

Hi I've been struggling with this course for a while now and I keep getting the same error message for Plurality pset3 that there is no target to make plurality. I renamed the file plurality.c and ...
0
votes
2answers
41 views

check50 for plurality

Every example I try myself works perfectly fine but once I check50 it, I get error messages for not printing one,two, or all three winners. I saw some people having format issues with spaces, but I ...
0
votes
0answers
13 views

CS50 pset 3 Plurality - Works until…Segmentation fault, and not enough vote prompts?

Task is to have people type in their votes for the candidates given in the command line, then the most voted candidate wins. I only need to and am allowed to write code for the last two function ...
1
vote
1answer
85 views

pset3 Plurality

Having an issure writing my plurality code pset. i wanted to have my programme promt a user when they have made an invalid vote entry. and it works ok but ive found a bug while testing it: code: #...
0
votes
1answer
71 views

pset 3 plurality

To figure out the winner, I am trying to do a bubble sort and then print the last name (or names if the last two are tied). For some reason, after it goes through the first run-through of the bubble ...
0
votes
2answers
262 views

CS50 pset3 plurality program gives error for print_winner function (did not print both winners of election)

I have finished the plurality program for pset3 of cs50, but upon running check50 on my code, I receive the following error directed towards the print_winner function: :) plurality.c exists :) ...
0
votes
1answer
152 views

Having problems with plurality for cs50

I am trying to run the program for plurality for cs50, and the program compiles I put my candidates in and number of voters and vote, but instead of printing the winner it gives me a segmentation ...
0
votes
1answer
42 views

My Plurality.c works when I test it with all of their usage examples but when I run check or submit it says it doesn't print

I'm a beginner and CS50 is the first coding experience I have. Like the title says, my code works when I test it but the CS50 won't accept it so I'm not sure what's wrong. Thanks for any help! ps. ...
0
votes
3answers
1k views

pset 3 plurality code help

My code prints all names in the case of a two way/threeway tie, but for some reason I still get an error message in check50 that it does not. The only thing I could think of was maybe it had to do ...
0
votes
0answers
139 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
362 views

Plurality vote strange errors

My code works consistently, but I get these two errors which I check it. I would like to know how to replicate these errors on my own so that I can figure out how to fix them. #include <stdio.h>...
0
votes
1answer
232 views

Plurality segmentation fault

I am getting a segmentation fault despite knowing that the size of the candidates[] array is the same as the value stored in the variable candidate_count and I am iterating through the array from 0 to ...
0
votes
1answer
71 views

why am I getting a segmentation fault?

so this is week three and I know we will learn about memory location next week. However I got a segmentation fault and don't know how to fix it or why it happened. // Update vote totals given a new ...
0
votes
1answer
152 views

why does it not return a value for bool?

So my code does not compile because it does not return a value. I don't know how to make it work and return true and false as it is in the if statement // Update vote totals given a new vote bool ...