3
votes
Accepted
bot50 invitation on me50
I think it's just an invitation for you to be able to pass the psets. When you pass psets it should be saved to a private repository of your github the link should just be github.com/me50/YourUsername
3
votes
Accepted
PSet5 case-insensitive using strcasecmp
Your word comparison appears to be case insensitive.
What about your hash function? Is it case sensitive? ;-)
If this answers your question, please click on the check mark to accept. Let's keep ...
2
votes
Accepted
PSET 4 Reflect help
So my swap function was switching the values of my variables but the variables themselves did not get switched so I had to write out the code to swap the variables (from what i'm told the swap ...
2
votes
Accepted
Pset2 Readability test fail "complex single sentence" Grade 9 instead of Grade 8
What is happening there, is that you did your word count asuming that the next caracter would be alphabetical, here: al = isalpha(text[i + 1]);, but in this case, the next caracter are quotation marks ...
1
vote
PSET 5 Hash help
You've got a few different problems. First, take a look at your first call to fopen(). You call it again to check if the result is NULL, but that's incorrect. Instead, try declaring a variable with ...
1
vote
PSET 5 Hash help
Let's talk about how you're using the hash function first. Here's your code:
hash(word)
Ignoring the missing semicolon, this is a normal function call. Since hash() returns an int, the code ...
1
vote
PSET 4 Errors: where did I go wrong?
For grayscale you should take a look to operator precedence in C (google). The result 'a + b / c' is not the same than '(a + b) / c'
For reflect a question: How many swaps do you need to do to flip ...
1
vote
PSET 1 Cash two inputs don't get appropriate value
You need to read the report more carefully. Yes, 7 coins for $1.60 would be correct. But the problem is the return value that the program is sending.
The spec says to print the number of coins, not ...
1
vote
PSET 1 Cash two inputs don't get appropriate value
The problem is this line: return change; For the main() function you're supposed to return 1 if there's been an error, or 0 if succeed.
1
vote
1
vote
pset2 readability. cannot compile although int is declared and code is complete. could someone please look into?
The variables that you create in the for loops only exist within that for loop.
You can use the result of a certain iteration of a for loop by eg: including an if function within the for loop to pick ...
1
vote
Accepted
pset2 readability. cannot compile although int is declared and code is complete. could someone please look into?
It's a scope problem: When you declare a variable inside a 'for' loop or a function, it only will be available until the loop/function ends. For example in your for loop: for(int i=0;text[i]!='\0';i++)...
1
vote
Accepted
pset3 Runoff help
Thanks to seans help I was able to figure out the issue, here is my new code:
bool vote(int voter, int rank, string name)
{
// iterates over candidates to see if name matches the name provided ...
1
vote
Getting this error: invalid operands to binary expression ('int' and 'int (int)') in the below code on ps1 cash.c
In the line changeOwed = changeOwed - biggestCoin;, you subtract a function from an integer. I assume you meant changeOwed = changeOwed - biggestCoin(changeOwed) instead, subtracting the return value ...
1
vote
Accepted
Problem Set 4 - Filter (Blur)
for (int i = 0; i < height; i++)
{
for (int j = 1; j < width; j++)
{
Your j variable here shouldn't start at 1.
1
vote
Accepted
2019-2020 Progression bar red beside finished
If it’s red it means you have not summited all the pset’s so you need to check which pset is marked as unfinished
1
vote
Accepted
PSET2 Caesar isdigit function works opposite way
isdigit(k) is testing whether the ascii value of k is in the range of 48 - 57. Those are the ascii representations of '0' through '9'; here is an ascii table for your review. But k is an integer from ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
cs50x2020 × 31cs50x × 17
pset4 × 6
pset1 × 4
pset4filter × 4
pset2 × 3
pset5 × 3
pset4recover × 3
pset3 × 2
finance × 2
load × 2
credit × 2
cash × 2
readability × 2
cs50-pset1 × 2
runtimeerror × 2
recover × 1
pset6 × 1
speller × 1
c × 1
pset8 × 1
caesar × 1
segmentation-fault × 1
error × 1
filter × 1