There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
brandon mac wrote:I have changed the code above before you did the thing to the post
brandon mac wrote: i think instead of doing the do while loop i changed it to the while loop
brandon mac wrote:so does it not see the IF statement below or does it have to get included in the loop as well
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
brandon mac wrote:I'm confused now it only does the println okay so does it not see the IF statement below or does it have to get included in the loop as well
Joanne
loop input for salary if value is not between 0 and 250000
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
loop input for salary if value is not between 0 and 250000
User Please input salary between value of 0 and 250000 //line 3
if value not between 0 and 250000
print statement input valid salary between 0 and 250000
User input salary between value 0 and 250000
ask user "Please input salary between value of 0 and 250000 "
get input from user
if value not between 0 and 250000
ask user "Please input salary between value of 0 and 250000 "
get input from user
if value not between 0 and 250000
ask user "Please input salary between value of 0 and 250000 "
get input from user
if value not between 0 and 250000
...
do this {
ask user "Please input salary between value of 0 and 250000 "
get input from user
} over and over until the values is > 0 and the values is < 250000
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Joanne
brandon mac wrote:It doesn't keep looping while between those #s what it does once it get the correct results it will move to ask years on job
Joanne
brandon mac wrote:This is strange let me dig around see if I can't figure this out.
Joanne Neal wrote:Your while loop doesn't contain any code - see if you can work out why - it's a common typo.
Joanne
Rico Felix wrote:Try this humble solution ...
We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.
Joanne
Joanne Neal wrote:
Rico Felix wrote:Try this humble solution ...
Please see the quote at the top of the Java Beginners forum
We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.
brandon mac wrote:Joanne,
I'm not the type of person to give up or quit but I don't think I know where to go with this as I have went thru the while command and the if statements I'm only doing a while loop not a do while loop. Please push me in the right direction you said a common typo are you talking about the while command I tried to use the && instead of the || and that didn't fix it either.
Joanne
brandon mac wrote:Joanne,
I removed the semi colon and reran it, however I think Rico has a valid point of the values that are contained in the which statement because its still not fully working. I also changed the or to the &&.
Joanne
brandon mac wrote:Joanne,
I removed the semi colon and reran it, however I think Rico has a valid point of the values that are contained in the which statement because its still not fully working. I also changed the or to the &&.
brandon mac wrote:Joanne,
I tried to use the && instead of the || and that didn't fix it either.
Let there be Code!!
Joanne Neal wrote:
brandon mac wrote:Joanne,
At the moment, you enter the while loop when the salary is between 0 and 250000. You actually want to enter it when the salary is outside that range.
Try
Let there be Code!!
brandon mac wrote:When the user provides input for salary that is between the specific values it should then move to the next statement that will be displayed asking for the users input of years on the job, however if not inputted correctly i want the loop to take affect and ask for a valid salary
Joanne