Questions tagged [runoff]

The tag has no usage guidance.

27 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
1answer
72 views

pset3 runoff help -> 3 :( showing on check50

I'm getting the following fails when I check pset3 runoff (all the rest are coming up as correct) :( tabulate counts votes when multiple candidates are eliminated tabulate function did not produce ...
1
vote
5answers
124 views

check50 errors - runoff

I've been trying to resolve these myself for too long - I'm officially stuck These are the check50 errors I get: :( tabulate counts votes when multiple candidates are eliminated :( find_min ignores ...
1
vote
1answer
841 views

pset3 (runoff) keep getting print_winner error when using check50

I keep getting these errors when running check50 on my runoff program: print_winner prints name when someone has a majority print_winner did not print winner of election print_winner returns ...
0
votes
0answers
8 views

Tabulate function in Runoff

Here is my code void tabulate(void) { for (int i = 0; i < candidate_count; i++) if (strcmp(candidates[preferences[i][0]].name, candidates[i].name) == 0) { ...
0
votes
1answer
11 views

Vote Function in Runoff

Here's my code bool vote(int voter, int rank, string name) { int j = 0; for (int i = 0; i < voter_count; i++) if (strcmp(name, candidates[i].name) == 0) { preferences[i][...
0
votes
0answers
13 views

Is my vote function correct in Runoff?

I have started runoff and just completed step 1 that is to write the vote function can someone tell me if it's correct? It seems to give the correct output but I don't think I used int rank in the ...
0
votes
0answers
5 views

pset 3 runoff - problem with tabulate

I am a (very) beginner coder, so pls be gentle!! I have numerous mistakes in my code, but am unsure how to fix them. The code is working for some things, and I have scored 73 % on the problem set, but ...
0
votes
1answer
29 views

CS50 Runoff Tabulate

So I have been working on the tabulate function and Check50 says that the function is correct and it does properly work when no candidate is eliminated and when one is eliminated, but not when ...
0
votes
1answer
54 views

My runoff problem doesn't pass check50

when I run check50 this is the message I get and I don't know what to fix :( tabulate counts votes when all candidates remain in election tabulate function did not produce correct vote totals :( ...
0
votes
1answer
23 views

*** No rule to make target 'runoff'. Stop. Even though I'm in the correct directory

I keep getting the No rule to make target error on the runoff problem even when I'm in the correct directory as you can see in the picture attached. Note: I have just completed the vote function for ...
0
votes
1answer
24 views

CS50 Runoff – Cannot get program to execute, am I stuck in an infinite loop somewhere?

I'm trying to execute runoff but after I enter the voters' ranks, the terminal window blinks back at me with nothing. I've scoured all over for similar problems but cannot figure out a solution. I've ...
0
votes
1answer
47 views

Pset3 runoff tabulation error

[![enter image description here][1]][1] I keep getting a tabulation error with check50 that I cannot replicate 11 voters, 4 candidates, 3 or 4 rounds of voting works fine with I run it, and debug50 ...
0
votes
0answers
51 views

Pset 3 runoff : I am getting{ :( runoff compiles code failed to compile}

I wrote my code but when I came to test it it gives me code failed to compile. I don't know why? :| here is my code #include <cs50.h> #include <stdio.h> #include <string.h> // Max ...
0
votes
1answer
60 views

Pset3 Runoff - Printing All Candidates

Could use some help with Runoff. If I do a simple clear winner (all voters vote for the same person as first choice) it prints out the winner just fine. But if I do the test input that the problem ...
0
votes
1answer
20 views

what does different return value signifies in this problem of runoff?

#include <cs50.h> #include <stdio.h> // Max voters and candidates #define MAX_VOTERS 100 #define MAX_CANDIDATES 9 // preferences[i][j] is jth preference for voter i int preferences[...
0
votes
1answer
57 views

pset3 runoff print_winner check50 error

So I have seen this issue mentioned here before and the others have suggested that printing a newline after the name is the solution. However, my code does print a newline and in my tests, I'm getting ...
0
votes
1answer
46 views

Back again with runoff problems, tabulate() passes no check50 tests

(I can't get formatting to work properly here so it might look a bit weird) void tabulate(void) { int j = 0; for(int i = 0; i < candidate_count; i++) { for( ; j < voter_count;) { ...
0
votes
1answer
142 views

PSET3 Runoff - tabulate() function for multiple eliminated candidates

I'm working on the tabulate() function, and to an extent the is_tie() function The tabulate() function passes all the tests of check50 but the last one: :( tabulate counts votes when multiple ...
0
votes
0answers
36 views

PSET3: More problems(weird loops and other unexpected results)

So I am still working on Runoff and I am having some weird results. It will return an obvious victory but any ties end up in weird loops and such. This has been apparent by adding printf functions ...
0
votes
1answer
63 views

PSET3 Runoff — cannot seem to resolve “is_tie detects tie after some candidates have been eliminated”

I have been looking up and down through my code to no avail. Check50 shows that all tests are successful except for "is_tie detects tie after some candidates have been eliminated". I haven't the ...
0
votes
0answers
20 views

Can't compile runoff. it shows me error in { placement. could someone look into it please

#include <cs50.h> #include <stdio.h> #include<string.h> // Max voters and candidates #define MAX_VOTERS 100 #define MAX_CANDIDATES 9 // preferences[i][j] is jth preference for ...
0
votes
1answer
62 views

cs50 pset3 runoff tabulate - why you say candidates[i].votes = 0 ; here?

why use that ?? for (int i = 0; i < candidate_count; i++) { candidates[i].votes = 0; } } return 0;
0
votes
0answers
15 views

i dont understend something in that solution

i dont understand this please explain to me bool won = print_winner(); if (won) { break; } and this too if (tie) { for (int i = 0; i < candidate_count; i++) ...
0
votes
0answers
346 views

Runoff - is_tie

Well I wrote my code and I don't know I am really stuck here with my code and can't get my head around it. Check50 returns only this error: :( is_tie detects tie after some candidates have been ...
0
votes
1answer
151 views

Pset 3 runoff Randomly Increasing Votecount

I'm close to solving pset 3 runoff but I've run into this interesting problem in my tabulate function. Whenever I run the program with the debugger, my vote counts keep increasing by very large ...
0
votes
1answer
232 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
2answers
72 views

Help with pset3 runoff

is this correct for vote function..struggled to figure out how to access candidate index so not sure if this is correct..any help/advice would be greatly appreciated bool vote(int voter, int rank, ...