Questions tagged [water.c]

The tag has no usage guidance.

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

Pset1 Water Issue, reprompting with “Retry: ” for Non-integers, and “Minutes: ” for negative integers

My water program seems to work decently, it passes all of the check50 tests just fine. My issue is that when the user enters a negative integer, the program re-prompts with "Minutes; ", but when the ...
0
votes
1answer
74 views

Error code for water.c again

I received great advice and they told me go back and study and fix my brackets and this is my new code include include int Minutes; int main(void) { do { int Minutes = get_int();...
0
votes
1answer
79 views

pset1 water how to only prompt once?

@MARS The negative number was solved with the help of "MARS" and "curiouskiwi" accounts, however now I got 2 prompts problems, one without the minutes, and one with the minutes, which result in 3 ...
0
votes
2answers
248 views

My pset1 Water Code Works as per the Spec, but Doesn't Pass the Check50

so I am very new to this but I have written some code to complete the pset1 water task and it just won't pass through check50 2016.water water.c. I have put it below, I understand that it maybe all ...
0
votes
2answers
161 views

Can't get past step 2 in water.c check50 2016.water water.c?

I've developed some code that seems to satisfy what I am being asked to do in the water.c coding project, yet when I go to check it using check50 2016.water water.c it gives me :( water.c compiles. ...
0
votes
1answer
27 views

Is there a better way to know when the loop is repeating?

I am trying to set an error message for when the user gets wrong. #include <cs50.h> #include <stdio.h> int main(void) { int minutes, ounces, bottles; do { printf("...
0
votes
1answer
115 views

pset1 water.c undeclared variable

This is what I have finally arrived at, I am getting 3 errors unused variable, undecalred variable, undeclared identifier minutes, even after declaring minutes outside my loop, I still get an error, I ...
0
votes
3answers
356 views

Pset1: Water- Infinite Loop

Ive encountered an infinite loop while writing code for the water assignment of pset1 Yeah, I realise Ive made a complete mess. Now Im lost as to how I should proceed further. Also I did the same ...
0
votes
2answers
76 views

Water homework week 1

I newbe in programming. When I run the Check50, error message is :) rejects "foo" minutes, :) rejects "" minutes, :) rejects "123abc" minutes. Please, can you tell me what it means so that I can work ...
1
vote
2answers
130 views

water.c exists but does not compile

![ My code works but it is not compiling. I ran check50 and it says that water.c exists :) but does not compile. I'm struggling to understand why.]1
0
votes
1answer
86 views

trying to declare variable outside of loop per the water.c walkthrough

Hello fellow CS50 pupils! I have spent the past few days experimenting on the suggestions given in water.c walkthrough by writing different snippets of code. I keep getting the following messages ...
0
votes
1answer
96 views

cant compile water.c

I'm new to this and this is the code ive written and cant figureout what i need to do to fix it. any help would be appreciated thank you #include <cs50.h> #include <stdio.h> #include <...
0
votes
1answer
57 views

code is compiled but not working, please give me feedback

#include <cs50.h> #include <stdio.h> int int(void) { printf("how much time you take for bath:"); int x=GetInt(); printf("total bottals:"); int y=12; printf("the ...
0
votes
1answer
103 views

Water.c Hacker1 check50 error

This program works fine. But check50 show this errors. Anyone can help me please. Thanks! check50 report: :) water.c exists :) water.c compiles :) 1 minute equals 12 bottles :) 2 minutes equals 24 ...
0
votes
1answer
438 views

Can't figure out this problem with water.c = error: expected identifier or '('

This is my current code for water.c #include <stdio.h> #include <cs50.h> //This calculates how many bottles of water is used in the shower int main (void); { do { Print("...
-1
votes
2answers
248 views

pset 1 water fails check50 “rejects ”foo“ minutes”

My output was okay but it showed this error. :( rejects "foo" minutes \ expected prompt for input, not exit code of 0 :( rejects "" minutes \ expected output, not a prompt for input :( rejects "...
0
votes
2answers
494 views

My water.c program won't compile - Pset1

I don't think I have using the whole "%" and "int" thing properly? I'm also not sure how to remove the formatting from the error message in this forum post, sorry. Here is my code: #include <...
0
votes
2answers
196 views

pset1 water task, function code ignored

I'm trying to grasp the use of functions with the cs50 library to complete the pset1 water task. My code will outright ignore the function I've written, I think this is due to line 10, but what am I ...
0
votes
2answers
171 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&...
0
votes
0answers
162 views

I have a error during compilation of pset1 water.c

Any idea why this error is showing clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wshadow water.c -lcs50 -lm -o water