Questions tagged [pset1]

The problem set for Week 1 introduces the C programming language.

Filter by
Sorted by
Tagged with
0 votes
0 answers
3 views

tilde ~ not showing in ssh set up

I've started Pset 1 and I'm currently implementing my codespace. After executing ssh-keygen, I have to execute cat ~/.ssh/id_rsa.pub. However, the tilde '~' does not appear in the vscode terminal and ...
user avatar
  • 1
0 votes
1 answer
30 views

CS 50 Pset 1 cash: non-void function does not return a value

I have finish a program and it can run smoothly on other platform like replit... But one I run it on vs code it shows the following error and it also have something weird happen when I run check 50 ...
user avatar
0 votes
0 answers
6 views

How do i resolve "Ssh key is weak" error trying to add new SSH key to git hub

Please how do I fix error in the title I get this when I try to add new SSH key to GitHub the key was generated using ssh-keygen as instructed on the cs50x course on edx am unable to proceed with the ...
user avatar
0 votes
1 answer
43 views

check50 issue on Problem Set 1: cash [duplicate]

I have finish my cash homework enter link description here But I face an issue that I can't check it even when I run the program successfully. My code is as below: #include <stdio.h> #...
user avatar
0 votes
1 answer
23 views

Cant get Codespace to work

Im up to the "Hello" module, week 1. Ive never programmed before so setting up copespace has been quite frustrating. I cannot get it to work. Can someone please help me? I want to get ...
user avatar
1 vote
1 answer
85 views

Check50 and style50 not working: pset1

I am getting this error when I am trying to use check50 or style50. Please help me with this. hello/ $ hello/ $ check50 cs50/problems/2022/x/hello Traceback (most recent call last): File "/usr/...
user avatar
0 votes
0 answers
15 views

*This contains spoiler to week 1. How can I make my credit.c more efficient?

I've submitted my assignment, it passed the functionality test and the style test, however, I'm wondering what I can do to make my code more compact. Here is the link to my code: https://github.com/...
user avatar
0 votes
2 answers
18 views

defining a char variable, why am i getting this error?

#include <cs50.h> #include <stdio.h> int main(void) { int height; do { height = get_int("height: "); } while (height < 1 || height> 8); const ...
user avatar
0 votes
1 answer
56 views

Problem set 1 instruction

I am unable to make Mario in Problem set 1. Are there any step-by-step instructions out there?
user avatar
0 votes
1 answer
56 views

cs50 Problem Set 1 Week 1

I have ZERO coding experience, and so I am having problems with the instructions on Problem Set 1, step 5 of the instructions: "Run update50 in your codespace’s terminal window to ensure your ...
user avatar
0 votes
1 answer
111 views

PSET 1 CASH stuck!

I am stuck with this problem. I'm wondering how to use the functions given to us at the top of the page (the template that was created after downloading the zip drive). There is a function about ...
user avatar
0 votes
1 answer
44 views

PSet1 - No such file or directory

I am working on pset1, mario-less comfy, and while trying to test the code to prompt for height, I am running into an message stating that there's no such file or directory. Can someone please help ...
user avatar
0 votes
0 answers
22 views

pset1 credit.c file EMPTY?

this is my first question in this community. I just downloaded the zip file for pset1, problem credit (more comfortable) is the file actually empty ? could it be that I did something wrong? thank you ...
user avatar
0 votes
1 answer
210 views

Problem with Pset1 cash 2022

I just try to do the Pset1 cash assignment and got a problem here(submit results). Got a message that expected prompt for input, found none for 41 cents, 160 cents, returns integer number of cents, ...
user avatar
  • 3
2 votes
1 answer
127 views

pset 1 cash – manual tests fine but still getting an error when I run check50

I've just finished cash and it seems to be working as expected when I run a manual test. When I run Check50 though I get the following message: :( calculate_nickels returns 5 when input is 28 expected ...
user avatar
  • 21
0 votes
1 answer
937 views

pset1 cash 2022

hello guys I got en error from check50 2022 which you can see it in my screenshot I check it 100 times but I can't resolve the problem can you please help me? #include <cs50.h> #include <...
user avatar
0 votes
0 answers
44 views

pset1 Mario error: expected identifier

I really tried to find the solution for myself, but after a lot of hours I give up. Here is the error message and code if its possible please help me:) *#include <cs50.h> #include <stdio.h&...
user avatar
0 votes
0 answers
17 views

Trying to get <cs50.h> on VIM Mac

I followed instruction from Github on how to add this library to mac. I went through the troubleshooting sections but my error did not show up as one of the common errors. Can anyone help? I don't ...
user avatar
0 votes
1 answer
50 views

credit.c I don't understand how to fix my code

I've been trying to figure out what's wrong with my code. I used printf so I could confirm whether or not the value of N is correct but it's coming out as completely different as what I would expect ...
user avatar
  • 1
0 votes
0 answers
41 views

PSET1 Credit error mistake

Hope this finds you well. I am having a little bit of trouble with PSET 1s credit problem, the code compiles fine but when running check50 it gives me a few errors. I tested one of the errors, where ...
user avatar
  • 3
0 votes
1 answer
32 views

CS50 Credit Pset problem- Code keeps looping back to ask for the credit card number

The following is my code for the Credit Pset from week 1 of CS50, it is not the complete solution to the problem (all the code does (rather is supposed to do) is for the user to enter a credit card ...
user avatar
  • 3
0 votes
1 answer
31 views

CS50 PS1 Cash - If statement nested within while loop

I figured out how to solve this using an alternative method, however, when I tried to debug my original code where I nested if statements (along with various if else statements) within a while loop, I ...
user avatar
0 votes
2 answers
29 views

Why won't the last line of my code print?

So I am attempting to run this code, but for some reason my final print function is not printing to the terminal. Can you help me figure out what I am doing wrong? #include <cs50.h> #include <...
user avatar
0 votes
0 answers
26 views

Can someone please help me I am trying to find what is it I am doing wrong here in pset1

I am in the dir ~/pset1/hello but it gives the same error again and again it does not show anything in the ls command.
user avatar
0 votes
1 answer
16 views

Credit problem: Opening parentheses not matched with closing

Though it might appear annoying, the program not compiling. To the best of my understanding, there is a closing parenthesis on line 37. Is it some cache related issue? https://drive.google.com/file/d/...
user avatar
1 vote
1 answer
43 views

Function in C: How to create

#include <stdio.h> #include <cs50.h> int main(void) { long creditcardno; do { creditcardno = get_long("enter"); } while (creditcardno < 0); } The above code accepts ...
user avatar
0 votes
1 answer
58 views

Caesar problem. Keep getting error of segmentation

The follow part of code worked perfectly, while I declared variables key_num and plaintext within if{}, but since I declared them outside (cause I need to use these vars later) I get the "...
user avatar
0 votes
2 answers
65 views

Pset1 credit, checksum value gives wrong value

I find myself stuck on credit. Can't figure out where the problem lies in my logic. Checksum gives 4 where it should give out 0. Ideas appreciated. //calculate checksum value int sum1, ...
user avatar
0 votes
1 answer
44 views

make: Nothing to be done for 'Mario'

I am confused.... :( Am I in the wrong directory?
user avatar
1 vote
1 answer
29 views

Pset1 - Population

I'm having trouble with the last bit of code, where the years are calculated and printed. The loop seems to run once fine. If I put in something like 12 to start and want to get 13 it will give me the ...
user avatar
  • 13
0 votes
0 answers
35 views

Error: use of undeclared identifier on an apparently declared variable

#include <stdio.h> #include <cs50.h> int main(void) { long creditcardno; do { creditcardno = get_long("enter"); } while (creditcardno<...
user avatar
0 votes
1 answer
1k views

clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm getting this error when I try to compile pset1 cash assignment, can someone please help? help50 also doesn't work so I really don't know what the problem is. enter image description here
user avatar
  • 5
0 votes
0 answers
65 views

CS50 Pset Credit

After working on this problem for 5+ hours I was able to get the code working. After I summitted it, I looked at other peoples solutions, and most of them were very different than mine. Is the style ...
user avatar
  • 1
0 votes
1 answer
26 views

make: *** No rule to make target 'cash'. Stop. error

I'm trying to compile this assignment but I keep receiving this message I read that the file name should match the folder name but the file's name is cash.c and it is in a folder named cash under the ...
user avatar
  • 5
0 votes
1 answer
1k views

CS50 LAB 2- SCRABBLE

Hi, anyone can help me. I can't get the result I need for this code. I need to compare words whether player 1 or 2 wins. I only get result for tie. I dont know which line to fix. I new in learning ...
user avatar
  • 1
0 votes
1 answer
107 views

What does it mean when it says "error: expected ';' in 'for' statement specifier"? It is referring to " for (k <= n; k--)" ... what's wrong with that?

This is for the Mario pyramid. I am having trouble with it. I finally got the left sided one working but I can't figure out how to put my .s and my #s on the same line when trying to make the side ...
user avatar
0 votes
1 answer
62 views

pset1 cash please help I'm stuck

can someone tell me why my code doesn't output properly? # include <stdio.h> # include <cs50.h> # include <math.h> int main(void) { int dollars; do { dollars = ...
user avatar
  • 1
0 votes
1 answer
57 views

Week 1 - Problem concerning question on 'credit'

#include <cs50.h> #include <stdio.h> int main (void) { //User's Input long n = get_long("Number: "); int sum_of_odds = 0; int sum_of_evens = 0; int count = ...
user avatar
0 votes
1 answer
13 views

week 1 no workspace?

I'm trying to get through the first 15minute of the lecture and already lost :( I tried to go through other questions that recommends to find the right ~workspace and ~pset1 but I don't know how to go ...
user avatar
0 votes
1 answer
21 views

function output?

I can't get this function to output the desired value of 0.07. #include <stdio.h> #include <cs50.h> #include <math.h> float i = 1.32; float quar_val = 0.25; int func(float val, ...
user avatar
0 votes
1 answer
47 views

CS50 problem set 1 CREDIT works sometime but not always

I am very new at coding and taking CS50. I am currently working on the credit problem in week 1. I finished coding but when I ran check 50 my code only seemed to work for some of the card numbers and ...
user avatar
0 votes
1 answer
67 views

problem with credit with this numbers (369421438430814 & 5673598276138003)

I just finished solving the credit problem and regularly used check50 to see my results, and then this happened. check50 sees that these numbers : 369421438430814 5673598276138003 are invalid, even ...
user avatar
0 votes
1 answer
50 views

How do I change if/else if statements into a loop?

I cannot figure out how to change the following code into a loop. This is just a portion of a larger code where n is defined by user input. How do I create a loop that adds one "#" to each ...
user avatar
  • 14
0 votes
1 answer
28 views

Recalling the function for output changes the input

#include <stdio.h> #include <cs50.h> #include <math.h> int procedure (int array[] , int length); int input_length ( long input ); int main (void) { long card = get_long("...
user avatar
  • 72
0 votes
1 answer
33 views

Credit (Pset1) - Do While Loop

I am still really new to C and programming in general(just started a week ago) and I'm having difficulty with the do while loop. My code doesn't run beyond while (ccNUM < 0);. I tried running ...
user avatar
0 votes
1 answer
43 views

credit pset1 cs50 sum while loop

I was doing the credit problem with the visa test card in the page: 4003600000000014 It passed that test, however in other tests it doesn't pass. I think it's a matter of the sum that it can't compute ...
user avatar
0 votes
2 answers
65 views

make: *** No rule to make target 'cash'. Stop

I have this problem. I'm trying to run this program but it keeps showing me this message and it confuses me since I have the file cash.c saved in the pset1 directory and cash (folder). I've looked for ...
user avatar
0 votes
1 answer
31 views

PSET1 - credit ,not satisfying all test cases ,please help

These are the test cases which my code doesn't satisfy ,can someone please help me out as i have absolutely no idea why it is happening. Some tips or advice would be handy. Thank you in advance. :( ...
user avatar
1 vote
1 answer
35 views

error: function definition is not allowed here( help!)

Not sure what the issue is, ive gotten this in all programs ive written with a function Would appreciate help Error message: cash.c:33:5: error: function definition is not allowed here #include <...
user avatar
0 votes
1 answer
33 views

I have to enter any letter to get the result

I am currently doing the problem set 1 credit in cs50 program. I managed to write the code. It's compiles fine however once I enter the credit card number it stops, i must type any letter to get the ...
user avatar

1
2 3 4 5
24