Questions tagged [pset1]
The problem set for Week 1 introduces the C programming language.
1,191 questions
0 votes
2 answers
85 views
cs50 pset 1 credit.c not outputting correct answers in certain random(?) cases
My code works fine for most of cs50's checks except all AMEX card type checks and some VISA type checks where it just outputs INVALID instead of the actual answer. #include <cs50.h> #include <...
0 votes
1 answer
39 views
Wk 1 cash assignment
This is the "pset1" cash assignment. When the user input is and odd number except ending with 5, the code doesn't return anything. Other than that, it works well.
-1 votes
1 answer
366 views
Error: format specifies type 'char *' but the argument has type 'char **' [-Wformat]
I am learning C and I am stuck on this, probably because I am dumb but idk #include <stdio.h> int main() { char name[25]; int age; printf("whats your ...
1 vote
1 answer
35 views
pset1 cash compiles but gives unexpected outputs
I'm having trouble figuring out why I'm getting the outputs that I am. I tried to write a function that I can re-use for each denomination of coin, not sure if the problem is there or somewhere else. ...
0 votes
1 answer
45 views
Can someone help me understand why we multiply the quarters by 25
// Subtract the value of those quarters from cents cents = cents - (quarters * 25);
1 vote
2 answers
111 views
Problem With Check50 for problem set "Credit"
I'm currently working on week 6 python and the problem sets are the same to that of pset 1 just with python instead of C. So when I decided to write it I saw that my code in C was extremely bad so I ...
1 vote
1 answer
55 views
CS50x PSET1 Credit <class 'pexpect.exceptions.EOF'>
So regarding Pset 1 Credit, I'm having this issue with Check50 My code identifies the card, but there's some error when input given at shorter length: My code are the following: #include <cs50.h&...
0 votes
1 answer
169 views
help fixing the spaces on mario's pyramid
I need some help figuring out how to change the number of spaces on each line of the pyramid. The pyramid comes out with 5 spaces at the beginning of each line instead of 4, then 3 then 2, etc. I ...
0 votes
1 answer
33 views
CS50 problem set_0 is talking about recording a 1-3min intro of presentation of yourself before submitting your Scratch project
==> SO I'm wondering, do I really need to record my self ? ==> or what if I don't ?, what's gonna happen, I won't be able to submit successfully ? my problem is I'm not comfortable talking in ...
1 vote
1 answer
43 views
PSET 1 Cash - How to reject negative input?
I'm using a do..while loop in the get_cents function, which has worked for me in the previous problems. What makes this program incorrect? #include <cs50.h> #include <stdio.h> int ...
1 vote
1 answer
82 views
CheckSum in credit pset1
as in the code given below i want to multiply 1 by 2 then delete it and so on but i don't how to do that i made the first steps to delete the last number by using %10 then show it with the /10 i hope ...
-1 votes
2 answers
61 views
PSET1: Receiving archive: cash.zip checkir error: cash exists but is not a directory unable to process cash/
Please see attached snippet below. I am having difficulty creating the 'cash' folder or directory. I have followed all the command prompts from 'cd' through 'wget https:' as shown in the cs50 ...
1 vote
1 answer
65 views
Credit : the checksum is correct for <10 digits, but for14,15,16 digits getting negative checksum
The checksum is correct for less than 10 digits but for 14-16 digits it is coming back negative. What am I doing wrong? #include <cs50.h> #include <stdio.h> #include <math.h> int ...
0 votes
1 answer
56 views
Relational comparison unused in pset1 cash
I have a relational comparison unused and my code fails to compile. int get_cents(void) { // TODO int cents = 0; do { cents = get_int("Total cents owed: &...
0 votes
0 answers
61 views
What do you think about my code here?
#include <cs50.h> #include <math.h> #include <stdio.h> #include <stdlib.h> int main(void) { long long credit_num; credit_num = get_long_long("credit number: "...