Questions tagged [pset1]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
76 views

pset1 greedy.c check 50 programm error

I am wandering around for answers. But I end up that my code is correct ( I'm 90% sure :P ) #include <cs50.h> #include <stdio.h> int main(void) { double change; do { ...
0
votes
2answers
14 views

PSET 1 Can't implement loop at the prompt

I'm still on my prompt part, couldn't get to the pyramid yet, my code compiles but I can't make the loop recursive, that is, after the first entry it goes back to the prompt $. Here is the code: #...
0
votes
2answers
127 views

Why isn't my block on pset1 turning into a staircase?

I am currently working on pset1 Mario, less comfortable. I am running my c to turn the hashtags into a staircase, but when I run the code, it is only a block. What is wrong with my code? Thank you all ...
0
votes
1answer
18 views

PSET1 Mario turning the stairs

I can't understand the logic of turning the stairs around. I ve spent hours looking it up and re watching the video... Can someone explain it to me using pseudocode?
0
votes
1answer
197 views

Vrtual Box error: low memory

I get this error when using VirtualBox: VirtualBox error ID: Host memory low; unable to allocate and lock memory, the virtual machine will be passed, please close applications to free up memory.<...
0
votes
3answers
484 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
1answer
10 views

Pset1 Cash less comfortable - not running for 0.41 and 0.01

-- hi im running into a problem with my code. It's executed pretty well with many inputs except for 0.41 and 0.01. It didn't print out any answer but just ran indefinitely... #include <stdio.h> #...
0
votes
2answers
36 views

pset 1 - cash problem - No errors, am rounding, but still not always correct amount of coins

I'm having trouble finding out where the problem with my code is on the Cash problem in the CS50 problem set 1. In the other questions for this problem on this forum it often seems to be the round() ...
0
votes
3answers
258 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
3answers
170 views

pset1 mario. can't fix errors, please help!

I can't understand what's wrong with the code. I've changed it many times, but errors are always similar.Can anyone please check the code and tell what's wrong?
0
votes
2answers
130 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
26 views

Please help!! Pset 1: creating a pyramid

I have been struggling with pset1: creating a pyramid for a long time. I am reading other people's codes to learn the logic but I still cannot understand what is going on. Would you please explain the ...
2
votes
1answer
171 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. ...
0
votes
1answer
36 views

i don't know what's wrong with my code. Trying to convert from string to long

INPUT int main(void) { long long cardnumber, calc; string credit[0]; string nonnumeric; //long long calc = card number; int countcardcharacters = 0; long long c; //user input do { credit[0]= ...
1
vote
2answers
107 views

Weird problem - gedit isn't saving changes to my mario code

I've restarted it several times, saved the code under another name and done everything I can think of but it isn't using the changes I've made. For example, I used dots to make the pyramid so I could ...
1
vote
3answers
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
0
votes
1answer
20 views

Question about Pset1 - credit

I had work on the credit for 3 hours, and I had reach to most of the function - and I checked that the number received from: Luhn (a) last digit(c) and digit count (cc) are right by using ...
0
votes
1answer
16 views

PSet1 Credit Invalid VISA that shows as Valid. My checksum must be wrong but dont know why

*/Here is the error I get: :( identifies 4111111111111113 as INVALID expected "INVALID\n", not "VISA\n" :( identifies 4222222222223 as INVALID expected "INVALID\n", not &...
0
votes
1answer
230 views

Problem in the do..while loop in Mario.c

before you block my answer for duplicates, I've spent over a day on this small bug. I've searched reddit, youtube and the stack exchange forums and still can't get it to work. I'm hopeless at this ...
1
vote
1answer
159 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?
0
votes
1answer
37 views

Help with Problem Set 1 Mario (less)

I have no idea what I am doing wrong here. Everything works just as specified, but for some reason I am still getting error messages. Please do not look at this if you have not already solved the it ...
1
vote
2answers
836 views

check50 says it's not authorized (it is)

Working on pset1 I have previously authorized my github for cs50.me. When I try to run check50 cs50/2017/x/hello, I get the error message "Looks like check50 isn't enabled for your account yet. Log ...
0
votes
1answer
147 views

Greedy. Help? I have no idea what to do

If anyone could give me any pointers on what is wrong with my code, it would be greatly appreciated! Also, any tips on how to be a better coder? Should I read more books / articles? Honestly, I am ...
0
votes
1answer
201 views

Mario pset1 a little hand please!

Spoiler alert code inside this link! !http://imgur.com/OIHvPFC I am having trouble with the mario, any tips of how i can get on with this? I have listed my integers at the start but maybe i over ...
0
votes
1answer
197 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 ...
1
vote
2answers
874 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 ...
1
vote
1answer
102 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?
0
votes
1answer
12 views

Directory structures

I'm trying to create a new directory inside my pset1 directory. When I execute "~/ $ mkdir ~/pset1/mario" I get "bash: /home/ubuntu/: Is a directory". I think I need a better ...
0
votes
2answers
73 views

Problem Set 1: IDE

I'm very new to computer science and was attempting Problem Set 1 when I ran into some trouble and decided I wanted to start fresh. I ended up deleting all the files. Now I no longer have the /...
0
votes
1answer
522 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
158 views

I can get the correct height for my pyramid but I can't get the spaces or #s to add or subtract properly in my loop

{ for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { printf("%d\n", j); } for (int k = n; k < n + 2; k++) { printf("#"); } printf(" \n"); return (0); }
0
votes
1answer
23 views

Cannot compile Mario (less comfortable) in PSET 1

I have finally made code that works and allows itself to be "made". However when I try to compile the code to submit it, it presents me with an error that says "undefined reference to '...
0
votes
1answer
25 views

My code does what I want it to do, but I get errors with check50 (PSET1, MARIO, LESS)

When I run my code in the terminal it gives me the correct response. However, check50 indicates there is an issue with my spaces. I have spend 2 days looking at it but I dont know whats wrong. INPUT /...
0
votes
1answer
354 views

Debugging problem caesar cipher pset1

I need some help with my debugging for the caesar cipher. I get these errors. [image replaced with actual errors produced by the code that follows] caesar.c:25:17: error: incompatible integer to ...
0
votes
2answers
33 views

PSET 1 Credit; Sometimes Check50 works and other times it doesn't

Why does Check50 work for certain credit numbers and not others? I ran debug and found that for some credit numbers and not others it may randomly be always one away from a multiple of 10 preventing ...
0
votes
1answer
113 views

Pset 1 Less comfortable - Number of Hashes

Sorry for the beginners's question. When I try to compile to following code for the Mario - Less Comfortable problem, I am printing the same number of hashes for each row and am unsure why. Code is ...
0
votes
1answer
88 views

CS50W - Wiki with Django - I want to edit a wiki entry, but I don't know how to send the default value to the template if I use Django forms

I've tried to do this: class editPage(forms.Form): title = forms.CharField() textContent = forms.CharField(widget=forms.Textarea(attrs={'class' : 'textContent'})) def edit(request,name): ...
0
votes
2answers
65 views

mario less comfortable help

I wrote this code for the mario problem but idk if it's right. i'm having trouble running it. It keeps saying error: linker command failed with exit code. #include <cs50.h> #include <stdio.h&...
0
votes
2answers
29 views

pset 1 Question about difference between Mario and Cash (get_float get_n)

As I was trying to structure the user input section of both problems, I ran into some errors that I don't understand. For Mario, I separated the user input of the problem and int main(void) by placing ...
0
votes
1answer
32 views

Can't submit or check

I'm trying to upload my assignment, but I keep getting the same error whenever I run the check50 or submit50 command: "Make sure your username and/or password are valid and submit50 is enabled ...
0
votes
2answers
61 views

Pset1 cash answer incorrect

//I don't understand why answer shows incorrect include <stdio.h> include <cs50.h> include <math.h> int main(void) { { double n; int c=0; do { n=get_double(&...
0
votes
1answer
20 views

Pset1 Creating and Changing Directory Does Nothing

For the first problem set, I attempted to create and change the directory with the following commands: $ mkdir ~/pset1 $ cd ~/pset1 $ mkdir ~/pset1/hello $ cd ~/pset1/hello Despite doing these ...
0
votes
1answer
93 views

pset1 less comfortable mario

Somebody please help me I have watched the walkthrough thrice, many different videos and searched for answers on reddit and stackexchange yet i've been stuck at this for hours now and cant get through....
0
votes
1answer
445 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
2answers
20 views

I cannot get the CS50 IDE to run clang for lesson 1

While trying to follow along with the professor during lesson one, I cannot get the CS50 IDE to run clang. I have tried renaming the file, restarting the program, and deleting and starting the code ...
0
votes
2answers
37 views

Pset1 How do I get my code to compile as it should?

I'm trying to get my code to compile properly and it just won't. I know the code works when using a printf and scanf but now that I've changed it to get_int and printf it is not working properly. I ...
0
votes
1answer
26 views

Check50 giving different results from the code I compiled in pset1

For Problem Set 1, I have the code as written below #include <cs50.h> #include <stdio.h> int card_length(long cNo); void luhn_algo(long lacno, int lacnolen); void finalPrint(int cardDet);...
0
votes
1answer
17 views

Why doesn't my code give me an output?

So I am very new to CS and I have been working hard twisting this code around in my mind trying to figure out why nothing happens when I run the program. It compiles fine, but whenever I put in any ...
0
votes
1answer
27 views

Coin count off by 1 in cash

When I input an amount into the program cash, it gives me one more coin than I should have and I'm not sure how to fix it #include <stdio.h> #include <cs50.h> #include <math.h> //...
0
votes
1answer
47 views

How do you check if a number is integer as part of if statement?

As part of the Mario assignment following lecture 1, I need to determine is the number input is an integer. What function can I use to do that? I have tried scanf("%d", &number), where number is a ...

1
2 3 4 5
22