Skip to main content

Questions tagged [pset1]

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

206 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
1 answer
190 views

How do I get past Chrome to submit assignments

I've got the three programs (hello, mario, and greedy) ready to submit but I can't get past Chrome, I have trouble remembering passwords, and they want to know the date I first signed up for Chrome. ...
Gene's user avatar
  • 31
1 vote
1 answer
13 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. ...
if_indeed's user avatar
1 vote
0 answers
81 views

rejects invalid populations and then handles population 20

#include <cs50.h> #include <stdio.h> int main(void) { int n; int End; // TODO: Prompt for start size do { n = get_int("Start size: "); } while ( n < 9); // TODO: Prompt for ...
SAMIM Amiry's user avatar
1 vote
0 answers
488 views

CS50py meal problem set 1 please help:)

This is my code for meal in problem set 1, when i manually input times the returned answer is correct but when i do check50 it says "Did not find "7.5" in "Breakfast\r\nI..."&...
Shiwoo Lee's user avatar
1 vote
1 answer
83 views

Week 1 - Problem concerning question on 'credit'

Consider: #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; ...
Felix Chen's user avatar
1 vote
0 answers
787 views

Every 2nd digit on Pset1 Credit problem: Tldr bolded

Im struggling with manipulating the string of numbers in the credit problem. I've figured out how to divide the initial input number by 10 (*100 each iteration) then mod % by 10 in order to access the ...
Cazadore's user avatar
1 vote
2 answers
1k views

pset1 mario pyramid

Below is my code for mario.c which compiles and prints the required pyramid but for some reasons didnt pass check50. // a program that recreates this half-pyramid using hashes (#) for blocks #...
Jere's user avatar
  • 37
1 vote
1 answer
150 views

Is it compulsory to use the appliance Chrome while uploading pset files?

In pset specifications, it is instructed to submit pset through Chrome inside appliance, not any other. Is it compulsory? I mean, can't anyone submit through any other computer? Or any other browser?
Abhishek Pokhrel's user avatar
1 vote
2 answers
905 views

pset1 mario: please help with my code

The below is what I have come up so far and the result is very underwhelming. It just doesn't work out as I expected. The first part works well but I am struggling with the second one. Any help would ...
Eglė Šeduikytė's user avatar
1 vote
1 answer
165 views

Program correctly responds to all the questions in gradebook but still not getting marks

My program for Greedy is correctly responding to all the questions in the gradebook but I'm still not getting marks. When I run check50 I get the following error: What should I do?
Anmol Narang's user avatar
1 vote
3 answers
1k views

Can't run the staff implementation

i can't run the staff implementation for any problem set, i always get the same error, it's always something like : bash: ~cs50/pset4/breakout: No such file or directory
user1383's user avatar
0 votes
1 answer
20 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);
Victoria's user avatar
0 votes
1 answer
14 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 ...
Oliverson's user avatar
0 votes
0 answers
33 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: "...
انس رفعت OR. ANAS REFAT's user avatar
0 votes
1 answer
27 views

For Loop to look through all values of an Array

So, I am learning C using cs50 and a problem I have run into is that although i have yet to learn about arrays, I need to use arrays for my problem set. I would really appreciate it if someone could ...
molearns's user avatar
0 votes
0 answers
18 views

Methods to run code not working

Whenever I try the ./ method to run the code, it simply doesn't work and keeps telling me its a directory. How else am I supposed to complete the course if the fundamental motor to run the code won't ...
Will Hoover's user avatar
0 votes
0 answers
16 views

Unpredictable counter behavior - pset1

I am working on the problem set 1, the credit problem. My plan is to split the user entered number into individual digits, and put them in an array. To start int l = 0; // length of number int count = ...
Camel old's user avatar
0 votes
1 answer
45 views

What can I add to my code to solve the practice problem set 1 week 1. The question is giving the prime numbers between the inputs minimum and maximum

bool prime(int number) { // TODO int newnum = number % 2; if (newnum > 0) { return number; } else { return false; } return number; }
Paul DP's user avatar
0 votes
1 answer
54 views

pset 1 mario less comfortable

I don't know how to put the dots. In walkthrough we are told come with formula but I don't know how to come up with formula. I have no idea what to do. }
Shah Hassan's user avatar
0 votes
2 answers
43 views

PSET 1 - Mario Less - Missing one last thing

I am missing one thing in the code because it's printing me the dots in every height case.. Can anyone give me a hint how to solve that ? int main(void) { int n; do { n = get_int("Height: &...
Nervossom's user avatar
0 votes
1 answer
243 views

Week 1 Lab 1 Population size

Im currently working on Lab 1 regarding the population size of llamas, and everything went smoothly however even though I am in the population_size folder and inside the file population.c right now, ...
Shawn Lim's user avatar
0 votes
1 answer
24 views

Submit50 giving different results from manual input

Doing the population growth (Week 1 Lab 1), and here's my code: #include <stdio.h> int main(void) { int start = 0; while (start < 9){ printf("Start size: "); ...
Sunraj Patel's user avatar
0 votes
1 answer
40 views

My pset1 (cash) code compiles but the outputs are wrongs. Could you Help me?

This is the code: #include <cs50.h> #include <stdio.h> int get_cents(void); int calculate_quarters(int cents); int calculate_dimes(int cents); int calculate_nickels(int cents); int ...
Santiago Misas's user avatar
0 votes
0 answers
32 views

Text is invisible in terminal

I can't see anything I type in my terminal. I can type a command + enter and the command is executed but still not see the text this happens every time I open VS code.
LKizza's user avatar
  • 1
0 votes
1 answer
48 views

Output problem credit

Finished my credit problem, whit the code below, but when I check it with check50 everything fails despite the output on the terminal being correct when I check manually. Code: #include <cs50.h> ...
harndt's user avatar
  • 1
0 votes
0 answers
11 views

when loop is given number like this i<333000000000000

it can't process the same, probably it's a bug .this is the snippet of my code. if you see the terminal you can notice when printing meow it, again and again, is twitching. I request to please look ...
Aryan Goel's user avatar
0 votes
1 answer
41 views

Error in compiling hello

When i try to compile hello.c i get the error that vis studios thinks the file is named studio.h
Alexandra Bartee's user avatar
0 votes
0 answers
83 views

CS50 Cash 2022 - Functionality / Prompt Bug

*I am incredibly new to all of this, it's possibly operator error due to lack of familiarity with the software I actually understand the math and the set-up of the code, but I don't understand VS code ...
Olivia's user avatar
  • 1
0 votes
1 answer
14 views

Timed out and Pattern changes

I have two issues with my program. When I command check50 I have "timed out while waiting for program to exit" in different lines of my program. I've already searched for an answer to solve ...
José Cuacés's user avatar
0 votes
2 answers
51 views

pset 1 mario less. My Code is printing in single row. I cant find what wrong with it

#include <cs50.h> #include <stdio.h> int main(void) { int n; do { n = get_int("Height: "); } while ((n < 1) || (n > 8)); for(int i = 0; i &...
Prateek Chaturvedi's user avatar
0 votes
1 answer
60 views

Pset1 Mario-More. When i try to compile it says "height" is uninitialized and i need to give it a value but isnt that what the "get_int" is for?

#include <cs50.h> #include <stdio.h> int main(void) { //get height int height; do { get_int ("Height: ");} while ( height <1 || height >8); // for (int y = ...
asanaya91's user avatar
0 votes
2 answers
388 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 ...
mandle565's user avatar
0 votes
1 answer
226 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 ...
cregg 's user avatar
0 votes
0 answers
91 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&...
Dayan Mehrani's user avatar
0 votes
1 answer
81 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 ...
vicraw215's user avatar
0 votes
0 answers
28 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.
Abdulrehman's user avatar
0 votes
1 answer
3k 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 ...
LeviH's user avatar
  • 1
0 votes
1 answer
27 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 ...
Clo Park's user avatar
0 votes
1 answer
146 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 ...
Julia Velloso's user avatar
0 votes
1 answer
64 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. :( ...
Dhyey Patel's user avatar
0 votes
3 answers
522 views

:( handles lack of argv[1] failed to execute program due to segmentation fault

if (argv[1] == NULL) { printf("Usage: ./caesar key\n"); return(1); } this is the solution before the program received the first statement validate null
ramon chacon's user avatar
0 votes
1 answer
85 views

the code which is expected and my actual code are the same but check50 see it as incorrect LAB1

#include <cs50.h> #include <stdio.h> int main(void) { // TODO: prompt for the start size int n; do { n = get_int("start size: "); } ...
Sheen Hary's user avatar
0 votes
1 answer
113 views

My do-while loop does not work

do { number = get_long_long("What is your credit card number? "); } while((number < 1000000000000) || (number >= 10000000000000000)); This loop is not accepting inputs. I do not ...
bobthebuilder's user avatar
0 votes
2 answers
58 views

pset1/credit outputs the right output but fails check

I'll share the printing part but not the calculation part, though happy to do that to it's just a bit lengthy. Nonetheless marked outputs are the right/expected output when run stand-alone but fails ...
nemethv's user avatar
0 votes
1 answer
54 views

Problem probably related to floating numbers from CS50 pset1 cash

how you doing? I can't figure out where is the bug from my code :/ It's really strange and the results are not the same if you do the same test with "0.01", for instance... #include <...
Gabriel Berezovsky's user avatar
0 votes
1 answer
47 views

Pset1 Credit - Why is my code bypassing the Floor function inside If statement?

Here's my code- int f_1 = floor(N / 1000000000000000); int f_2 = floor(N / 1000000000000); int f_3 = floor(N / 100000000000000); int f_4 = floor(N / 10000000000000); if (...
VooDooDarkMagic's user avatar
0 votes
1 answer
70 views

Can you tell me my mistake? ;)

Could anybody tell me what my mistakes are ? #include <stdio.h> #include <math.h> int main (void) { float dollar; do { dollar=get_float("Enter your ...
Anastasia Toska's user avatar
0 votes
0 answers
31 views

Could anyone explain the error message?

#include <cs50.h> #include <stdio.h> #include <math.h> int main (void) { float dollar; do { dollar = get_float("Enter your change"); } while (...
Anastasia Toska's user avatar
0 votes
2 answers
213 views

Hello everybody : ) Can you help me out?

$ clang cash.c /tmp/cash-94cd4e.o: In function main': cash.c:(.text+0x1c): undefined reference to get_float' cash.c:(.text+0x44): undefined reference to `round' clang: error: linker command failed ...
Anastasia Toska's user avatar
0 votes
1 answer
85 views

pset1 credit: I am unable to identify what's wrong in the logic of my code?

Kindly tell me what mistake have I made in this program? pset1 Credit: (my code) https://pastebin.pl/view/5646dbf1
AnishGhule-Technogeek's user avatar

1
2 3 4 5