Questions tagged [pset1]

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

186 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
2answers
192 views

getting wrong output in pset1 in Greedy problem

I am working on pset1 greedy problem. I am getting wrong output. I have written just logical part here. x=getfloat(); x=x*100; if(x>=q) { count+=x/q; //q= quarter x+=x%q; } same for ...
0
votes
2answers
463 views

pset1 Mario. Spaces work, hashes don't and i can't see why

So I have been working on CS50's pset 1, making marios half pyramid. I have been looking over other problems on this site and I've gotten this far. But I can't seem to see what the problem is with my ...
0
votes
0answers
25 views

Code Posting for all problem sets

Can I submit my code as a turbo c file or its converted notepad file ? There's some problem with the software installation at my side. Please let me know at the earliest !!
0
votes
0answers
28 views

Request fr re-evaluation of my Pset1 prgrms

I am Mahesh from India. I had submitted my prob set1 answers on 29th march n it has been graded n my score is 0.61. I was expecting a full score of 1.0, as my answers met with the requirements of the ...
0
votes
3answers
503 views

Do While Loop Bug in CS50.H with getInt()

I have two sets of similar Do While codes files, one with stdin scanf function and the other getInt() from cs50 lib. Both files compile in CS50 appliance. I expect the do while works the same but ...
0
votes
0answers
65 views

PSet1 Code works in CodeBlocks but not in cs50 appliance?

Any idea why this is happening? I made my code in codeblocks and transfered it to the appliance through the dropbox and it compiles but does not run when i do ./mario .. so why is this? it compiles ...
0
votes
0answers
129 views

How to check for floating point overflow? (greedy)

Out of curiosity, how do I check for maximum (float) input value / prevent float overflow for greedy?
0
votes
0answers
122 views

hacker credit expected output

I'm getting that dreaded "expected output" error when running check50. Thing is, I don't have an added newline \n in my code. The actual output sure appears to be identical to what the checker was ...
0
votes
1answer
463 views

pset1 greedy: my code counts only quarters

After 2 days of getting the same result with pset1 greedy I am a bit desperate here to figure out what I am missing. My pset1 greedy compiles properly but it doesn't yield correct results. I ran ...
0
votes
1answer
257 views

pset3: How to check for paddle edges?

When implementing breakout, i am having a hard time trying to figure out how to check if the ball hits the horizontal edges of the paddle. So far everything else works fine, but when the ball touches ...
0
votes
1answer
205 views

Greedy and Zamyla's pseudo-code

In the Walkthrough for Greedy.c, Zamyla asked if you can spot her error: > get amount in dollars > while (quarters can be used) increase count amount decrease by a quarter ...
0
votes
0answers
77 views

how can i get this version of gedit?

I downloaded gedit and it was not similar to the gedit used in CS50. I want to know which version of gedit is used and where can we get that?
0
votes
1answer
852 views

What is “expected output, not an exit code of 0” on Mario check50?

Despite having the correct output, submitting Mario, did not getany credit at all. Went over previous Q & A's; didn't find similar issues. Height: 8 ## ### #### ##### ##...
0
votes
1answer
532 views

greedy nested while loops works only for two line

I don't understand what is going on with my code for greedy. When I nest while loops for quarters and dimes, it gives me the right amount of coins used, but when I increase a similar while loop for ...
0
votes
1answer
454 views

How to check if a problem set is graded?

I submitted problem set 1 in the last week of August, 2014. How would I know if it has been graded? Snapshot: Why does it show "Ungraded?"
0
votes
0answers
19 views

Enrolment and sbmitting programs

I finished pset1, when I tried to submit it told me I wasn't enrolled. How do you find out if your enrolled, and how do you enroll. I thought I had.
0
votes
2answers
131 views

Problemset 1-setting up pset1 directorory in dropbox-clarification of my earlier question

0 votes 0 answers 2 views Problemset 1-setting up pset1 directorory in dropbox Problemset 1-setting up pset1 directorory in dropbox When I double clicked icon Home above Appliance 50-19 vmware ...
0
votes
1answer
176 views

pset1 mario compiles and works, but cs50 shows error in compiling

My mario.c compiled and worked fine. But when I try to check it with cs50 check, it gives me these errors: :) mario.c exists :( mario.c compiles \ expected an exit code of 0, not standard error of "...
0
votes
1answer
657 views

Problem with “expression result unused error” in for-loop?

I am getting an error message of "expression result unused" for the bottom two for loops (specifically h + 1 and s - 1). I've tried looking for through the other questions for an answer but nothing ...
0
votes
2answers
50 views

why does this not allow coins =0.01 and greater?

{ float coins; do { printf ("please pick an positive number\n"); coins = GetFloat(); } while ( coins < 0.01 ); printf("%f", coins ); }
0
votes
3answers
264 views

How to apply my formula in pset1 mario.c for draw?

#include <cs50.h> #include <stdio.h> /*I know that for the number of rows for ( ; i < h; ) can help, I think spaces work like (h-1) or (h--); and hashes (i + 1)*/ int main(void) { ...
0
votes
1answer
501 views

CS50 PSET 1 Hacker Bad Credit Code

The goal is to find if a credit card number is valid. Complete Instructions Here: https://cdn.cs50.net/2015/x/psets/1/hacker1/hacker1.html#bad_credit Can I please know what makes my code fail? (I ...
0
votes
2answers
183 views

pset1 mario Initializing for loop from GetInt

I'm running the Mario program and I have everything working except the correct count, which I can fix. The only issue I'm having is a syntactical one. I'm tying to initialize the "for loop" with the ...
0
votes
2answers
172 views

Water code syntax error

I have been attempting to create the water code for pset1, but when I try to compile, it sends me an error message. I am wondering if my code contains a syntax error. Here it is: #include <stdio.h&...
-1
votes
1answer
54 views

pset1 ---------— mario less

I am not understanding as to what is expected when it says " rejects a height of -1 expected program to reject input, but it did not" what is "reject input"? please help
-1
votes
1answer
81 views

Im having trouble compiling hello.c.. What am I missing?

Here is the cs50 hello.c file as is. Why wont it compile? #include <cs50.h> #include <stdio.h> int main(void) { printf("hello, world\n"); }
-1
votes
1answer
219 views

Problem Set 1 - mario.c (Help)

So after scratching my head for a long time I figured out the algorithm to approach the "Itsa Mario" program. This is the code I wrote and I am horribly stuck. The compiler gives errors when I try to ...
-1
votes
1answer
51 views

why can't my code work?

#include <stdio.h> #include <cs50.h> #include <math.h> int main (void) { float change; do { printf ("O hai! How much change is owed?\n"); change = GetFloat(); } while (...
-1
votes
1answer
129 views

I don't understand this code

[code hidden to comply to academic honesty] This is someone else's work, and I was just trying to understand it, and I don't understand the lines that start with "for". What does it do? How does it ...
-1
votes
1answer
93 views

pset 1 greedy help !! wrong calculation

/******************************************************************************************** * greedy.c * * CS50 Problem Set 1 * * since i live in UAE ill will use UAE notes because we dont deal ...
-1
votes
1answer
259 views

I need help with pset1 mario. Can't print the pyramid

I can get the users input but i cant print the pyramid. i can only get the spaces on the first line. Plus this is the same part that i got stuck on last year and i am only 13.
-1
votes
1answer
139 views

My code for mario only produces one hash and I can't see why

I've been working for hours and I think I'm finally close to the solution, but I create the program and only one hash appears after the prompt for the height. please take a look at my code and let me ...
-1
votes
1answer
148 views

Error in mario.c output

My code output looks like: But still check50 shows the following error:
-2
votes
2answers
378 views

:( cash compiles expected exit code 0, not 1

I have tried everything to solve this. I have searched googled, use help50 and even debugger50. My program runs fine, the problem consist when I use check50. i get " :( cash compiles expected exit ...
-3
votes
1answer
131 views

What's wrong with my Mario code?

I'm stuck on pset1 with the for loops. I think I got the idea but the output is wrong. Does anyone know why? My faulty pseudo-code is below. Move your mouse on top of it to reveal it if you've ...
-3
votes
1answer
95 views

When I try dividing “remaining amount” by 5, the remainder is always = 1. Why?

#include<stdio.h> #include<math.h> #include<cs50.h> int main (void) { int a; float x; int b,c,d,e,f,g; int coins = 0; printf("How much change is owed?\n"); do { x=GetFloat(); ...

1 2 3
4