Questions tagged [pset]
The pset tag has no usage guidance.
84
questions
0
votes
1
answer
21
views
How to solve "error: expected expression" while doing Caesar.c
I'm trying to solve Caesar but i keep getting this error:
caesar.c:37:20: error: expected expression
s[i] = char(int(text[i]+k-97)%26+97); \\ the arrow points to the 'c' in char
#include <ctype.h&...
0
votes
1
answer
94
views
Credit card problem: Unable to calculate the sum of entered credit card no
#include <stdio.h>
#include <cs50.h>
int main(void)
{
long creditcardno;
do
{
creditcardno = get_long("enter");
}
while (creditcardno < 1000000000000 || creditcardno > ...
1
vote
1
answer
426
views
CS50 pset2 substitution - timed out while waiting for program to exit
I tried all the provided examples on the pset2 site, and I got all of them correct. But when I used check50 to check my code, it said: "timed out while waiting for program to exit" for some ...
0
votes
0
answers
35
views
My DNA program is showing me this error repeatedly
The error is written below:
Traceback (most recent call last):
File "/home/ubuntu/pset/pset6/dna/dna.py", line 54, in <module>
main()
File "/home/ubuntu/pset/pset6/dna/dna....
0
votes
0
answers
67
views
My Filter program is not blurring the image correctly. And it is not able to open the input file. It shows it as NULL
Here is my code:
#include"helpers.h"
#include<math.h>
#include<stdio.h>
#include<stdlib.h>
// Convert image to grayscale
void grayscale(int height, int width, RGBTRIPLE ...
0
votes
0
answers
50
views
Skipping More Comfortable psets
People who have completed the psets how often did you skip the more comfortable psets and did you complete them all before submitting the course and if not did you miss out on stuff due to that?
0
votes
0
answers
86
views
Private cs50 Repository
Whenever I submit the psets they are added to a private repository in my Github account. After I complete the course will I be able to make them public too? Is it a good idea to add a readme file ...
0
votes
1
answer
30
views
Segmentation Error while Using if Statement for Pset2 Caesar
I have been working on Caesar for some time now and tried to use different loops but I am getting Segmentation Errors.
#include <stdio.h>
#include <cs50.h>
#include <stdlib.h>
#...
0
votes
1
answer
53
views
credit pset1 bruteforcing doesn't work
I was trying out credit and tried to write a code for all 15 digit cards so if a AMEX card exists it should work in theory. However even with valid cards I'm getting the input invalid. I have not ...
0
votes
1
answer
23
views
Not able to access CS50 sandbox
I am not finding the link that directs me to CS50 sandbox. So, I am using the CS50 IDE. But when I am submitting the assignment in CS50 IDE the score is not getting updated. What should I do??
0
votes
1
answer
21
views
check50 on recover pset 4 saying this what am i doing wrong
:) recover.c exists.
:) recover.c compiles.
:( handles lack of forensic image
expected exit code 1, not 0
:) recovers 000.jpg correctly
:) recovers middle images correctly
:) recovers 049.jpg ...
0
votes
1
answer
112
views
PSET 2 Substitution
My question is about a cs50 PSET. The goal is to create some sort of encryption program. From command line arguments there is a key inputted and every key letter should be replaced with the alphabet ...
0
votes
2
answers
59
views
Can't write jpegs in recover, segmentation fault
here's the code i wrote:
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
typedef uint8_t BYTE;
//take command line argument from the user for the file name
int main(int ...
0
votes
1
answer
894
views
Problem Set 6 - DNA (Using the DictReader function)
Currently my code functions in so far that I get the appropriate results for the maximum STR counts when I pass a certain sequence. However, I have no clue as to what I should do to progress; I tried ...
0
votes
1
answer
24
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
1
answer
271
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
0
answers
41
views
stuck on pset 8 finance [duplicate]
I have an error in set 8 finance. It says
:( buy handles valid purchase
expected to find "112.00" in page, but it wasn't found
sending POST request to /login
sending POST request to /buy
...
0
votes
0
answers
26
views
Why CS50 2019 excluded MashUp problem set?
everyone
I have noticed that staff solution for MashUp problem set is not working correctly , displaying same articles for any location in USA and having waterMark ( "for development purposes only")....
0
votes
1
answer
385
views
PSet 2: Caesar, validating key
I'm struggling with the output to the "Validating Caesar's Key" part of PSet 2. First-timer here, like many, and appreciative of any insight. When I compile and then run this program with "./caesar 2",...
0
votes
1
answer
37
views
Resize compliling but gives me grey and white blocks lol!
I don't know what went went wrong! I'd understand if it was giving me coloured blocks and it's messed up in some order but it's just white and grey?
#include <stdio.h>
#include <stdlib.h>
...
0
votes
1
answer
823
views
Pset 1: Cash help
I've put together my answer for the cash problem set, but when I run the program and enter an amount for "change owed" it always outputs 1. Being new to all of this, I'm not sure what I'm doing wrong ...
0
votes
1
answer
50
views
Check50 has Blank Output
I am trying to run check50 on my code, but it does not return anything; the output is blank, and it only returns a link to a check on https://cs50.me.
Anyone know how to fix this problem
0
votes
1
answer
100
views
I need help with cash - again
Ok so this is my improved code:
#include <stdio.h>
#include <cs50.h>
#include <math.h>
int main (void)
{
float c;
int a, n=0;
do
{
c = get_float("Change: ");
}
while (...
0
votes
1
answer
139
views
CS50 AP: Pennies
I'm wondering why a lot of my answers are off by 0.01 or a very small amount. Here are the results from check50:
:) pennies.c exists
:) pennies.c compiles
:( 28 days, 1 penny on day one yields $...
1
vote
1
answer
270
views
This should be right (Caesar)
After spending pretty much a whole day on this, I have gotten it to work fine, it does all that was demanded but when submitted, I am still getting 1/5 on correctness. :( someone tell me if I left ...
0
votes
1
answer
35
views
music pset - semantic error
I implemented the music program in pc and I omitted the cs50.h library since I work offline most of the time. Everything's fine actually my code did not give me error messages and it compiled ...
3
votes
2
answers
169
views
Which loop can be replaced for nested for loops for PSET 1 (Mario More Comfortable)?
According to the cs50 style guide for C, more than 3 variables for iteration is not a good practice. I have done Pset 1 (Mario more comfortable) with 5 for loops, so it has 5 iterations variables. Is ...
0
votes
1
answer
256
views
Submissions via check50 does not appear on cs50.me
I have submitted my problem sets via check50 as instructed, but when I go onto my cs50.me page and check my scores, it says "No Submissions" next to each problem set. I have already linked my edx ...
0
votes
1
answer
322
views
Handlebars.compile() not behaving as expected
I am trying to use handlebars.compile() to generate my HTML unordered list items in my getJSON() callback function:
function addMarker(place)
{
...
// add event listener to open info window ...
0
votes
1
answer
92
views
pset 4 resize please help
//CREATE A PROGRAM TO RESIZE A BITMAP FILE
//include C libraries
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "bmp.h"
int main(int argc, char* argv[])
{
//...
0
votes
1
answer
29
views
Why does the strcmp() give 17 instead of 0 between the second characters of dave and baca
int main(void)
{
int i;
char* kw = get_string(Enter keyword: \n");
char* plntext = get_string(Enter plaintext: \n);
for(i = 0;i < strlen(kw); i++)
{
printf("%s, ", kw[i])...
0
votes
1
answer
247
views
pset1 cash.c Do While loop executing even when condition = false?
I am inputting 0.26 into cash.c, and after the first do while loop in my program, f = 0.00999999046
My second do while loop condition is f >= 0.10, yet it is executed even though f is less than that. ...
0
votes
1
answer
93
views
CS50 Pset 4/Recover-retains 50 broken JPEGs
My code compiles/executes and retains 50 JPEGs, however, these JPEGs are broken, I have gone through my code many of times, have discarded other versions, I seem to be missing something I can't spot ...
0
votes
1
answer
133
views
imprecision problem cs50 greedy
#include < cs50.h >
#include < stdio.h >
int main(void) {
float change;
int quarter = 25;
int dime = 10;
int nickel = 5;
int penny = 1;
int counter = 0;
int c ...
0
votes
1
answer
94
views
CS50 is great but I need some help
I like the course, it's for me the best CS course online but I need some resources.
The Psets are getting a little hard to solve.
I need some help with the C language in general to think more ...
0
votes
1
answer
37
views
Trying to use functions to modify pset2 Caesar characters, get error: expression result unused for each function
So I'm working on pset2's Caesar and wanted decided it would be better to put the algorithm into functions, with each function operating based on whether a character is uppercase or lowercase. Now ...
1
vote
1
answer
6k
views
CS50 IDE undefined reference to `get_int'
I've created a new workspace on cloud9, and ran update50 as suggested in the answer to this similar question: Undefined reference to get_int
However, I still receive the exception 'undefined ...
0
votes
1
answer
125
views
Pset 3 helpers.c check 50 errors
#include <cs50.h>
#include <stdio.h>
#include "helpers.h"
//TODO binearysearch, om te controlere van de waarde.
bool search(int value, int values[], int n)
{
int left = 0;
int ...
0
votes
1
answer
293
views
Blank jpegs pset 4 recover
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <cs50.h>
int main(int argc,char *argv[])
{
if (argc != 2)
{
fprintf(stderr, "usage: ./recover ...
0
votes
1
answer
226
views
Unable to submit problem set 0 on edX
When I click the submit link, it takes me to the Week's 0 video short on Scratch. Where I can submit it?
0
votes
1
answer
171
views
Pset5: Check returns all as misspelled (trie)
I can't, for the life of me, figure out why my check function doesn't work properly. I have triple-checked my load() every way I know how and believe the data structure is properly setup. Why doesn't ...
0
votes
1
answer
83
views
pset2 Caesar, not able to print chypertext text
I'm trying to solve the Caesar problem.
if you look at my code, I tried to iterate through the "plaintext" value with a for loop. My aim was at every alphabetical character to apply the chypher ...
0
votes
1
answer
101
views
initialization; condition; update in mario.c less comfortable
I am really having a problem with developing the "initialization; condition; update" part of my for loop in my mario (less comfortable) code
could anyone help me with understanding what to input
0
votes
1
answer
54
views
any one having trouble opening Pset links
Have not been able to open any of Pset links, able to watch videos of lectures and shorts!
any thoughts?
Thanks
0
votes
1
answer
1k
views
pset2//caesar- relational operator result unused error
my code-->
#include<stdio.h>
#include<cs50.h>
#include<string.h>
#include<ctype.h>
#include<stdlib.h>
int main(int argc, string argv[])
{
if(argc!=2)
...
0
votes
1
answer
214
views
problem resizing horizontally
I've started out this problem as bad as it gets :( trying very hard to understand bitmab files and how they work (especially padding) for a few days(as I'm not a native English speaker).
now that I ...
1
vote
2
answers
2k
views
Set foreign key in phpLiteAdmin
Does anyone know how to set a foreign key using the phpLiteAdmin interface? The docs for this application are lacking, and the recommended syntax for adding a column using SQLite does not appear to ...
0
votes
1
answer
105
views
Recover is Producing Corrupt JPEGS
Here's my code. I've got print debugging statements in there. The output seems to indicated that everything is going well, but when I open up the files, they are blank. I inspected the JPEGS with ...
0
votes
1
answer
153
views
so im working on skittles pset and
skittles.c:6:1: error: expected identifier or '('
{
^
this is my error
and this is my uncleaned up code
#include <stdio.h>
#include <cs50.h>
int main(void);
{
int tries = (0);
int ...
0
votes
1
answer
816
views
APCS50 Problem: Fahrenheit
ok so im in CS50AP which means for you who dont know mean im in high school so i could use some help with this
right now my code for fahrenheit is:
#include <cs50.h>
#include <stdio.h>
...