Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Cody Biggs

Ranch Hand
+ Follow
since Jun 21, 2016
Cows and Likes
Cows
Total received
2
In last 30 days
0
Total given
0
Likes
Total received
4
Received in last 30 days
0
Total given
4
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Cody Biggs

So I just put it in a function and it works now. that line of code to get the value of the input I just had sitting there. Nothing to trigger it...

also Ive been going through udemy course for web development, in the video the instructor Colt Steele mentions that .on is more used than just a .click?

So I have a input with type text, and I am trying to add what was entered in the input to the array. I added an alert and console.log to see if it was working, and I do not get anything for either. no errors.

how would I add a third color? So I have text that just says congratulations, and after every half second or so I want the color to change. I got Two color, but what if I wanted three, or four?

So here is what I have. isGreen is set to false, so if the color is green I want to change the color to blue. Since green is false it skips the if, and goes to the else changing the color to green. isGreen become true after that, and the color changes to blue. However if I wanted say red in there how could I do it? I couldnt add another bool to check the color, because if I set that to true at first the color will never reach the else because both boolean colors are switching off.

Finally got it working. I’m not sure what is was really. Using && was not working when I first ran it, and looked like it was stuck in the loop. So I just erased the whole line, and wrote it again. Not sure why, but that time it got everything working. Ended up getting a 94 in the assignment. Most frustrating assignment I’ve had.
3 weeks ago
Still can not figure out why it wont print!!! I was told that the problem was my while condition

then in one of the emails I get this message
" You want to stay in the loop as long as there is  someone in the waiting room AND you haven't found a living patient." But now i obviously can not get out of the loop for anything to print. So I changed it to like what he said


Still no luck. I dont freaking KNOW!!!
3 weeks ago
Scratch all that above. got an email from the instructor.

Still where I was before the two previous post
3 weeks ago
got the stupid thing to print but now ignores all my total expired++ and my max patients

3 weeks ago
So I think I have found the problem, but no idea how to solve it. So the code never breaks out of the while loop. instructor has currenttime set to 0, so in the condition time is never going to be greater than the last possible moment. And since the patient never died it does not get a new patient meaning the other condition is never met. Now the only this is how to solve that......even setting current time to something else, the last possible moment is still higher
3 weeks ago
So I have added some simple writelines, and have figured out that nothing after the while in the code below gets printed. not sure why

3 weeks ago
This what I have now


full class now. When I run it, it does not print the lines at the bottom. I still need to figure out the rest of those times below, but for people expired, total time, and total patients I think I got. It just does not print. The only thing that prints is the first console.writeline where is prints usePriority, after that nothing shows up

3 weeks ago
The ones we have really used this semester are foreach. The ones I have only used are while, for, foreach
3 weeks ago
Well I have no idea.
3 weeks ago
Yea, thats why I trashed that idea. The only other thing I can think of would be a loop, and I was thinking of a for each that goes through the waiting room and just checks the above if statement again. So originally something like. Which wont work because the Iqueue class does not contain a definition for getEnumerator



So I thought of just a normal loop, but thats not going to go through my queue, just loop how many patients
3 weeks ago