Posts
 
Reputation
Joined
Last Seen
Ranked #2K
Strength to Increase Rep
+1
Strength to Decrease Rep
-0
90% Quality Score
Upvotes Received
9
Posts with Upvotes
8
Upvoting Members
6
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
2 Commented Posts
0 Endorsements
Ranked #13.9K
Ranked #2K
~6K People Reached
Favorite Tags
Member Avatar for Tom_33

It's pretty vague. Can you give examples of other kinds of "operators" and "iteration patterns"?

Member Avatar for Reverend Jim
1
629
Member Avatar for Violet_82

I don't believe that you ever really meant this: for(Observer user : users){ for(Product currentProduct : products){ currentProduct.addObserver(user); currentProduct.setAvailable(true); } } You meant this: for(Product currentProduct : products){ for(Observer user : users){ currentProduct.addObserver(user); } currentProduct.setAvailable(true); } The first way it adds the first user then notifies him for each product, …

Member Avatar for Violet_82
0
1K
Member Avatar for Trevah

A c++ program that prompts the user to input high or low, if the person inputs high it prompts the user to input red or black. If the user inputs black it outputs "You get ice cream" however if the person inputs red the program outputs "Why I oughta...!" If …

Member Avatar for Reverend Jim
-1
233
Member Avatar for Hamsterking

Take a close look at your swap. There's an error there! Your loop condition should be < instead of <=. And you can just say `half = DIM / 2;`

Member Avatar for Hamsterking
0
464
Member Avatar for Jon_7

Just an idea, and not a complete one at that. On the USB stick, install the chrome browser and also chromedriver, a program that automates the browser, so I'm assuming it could be used to enter a password in a form (which will show up as asterisks, of course). Create …

Member Avatar for Jon_7
0
737
Member Avatar for EvolutionFallen

What about the set intersection operator & [1, 3, 5, 7] & [0, 1, 4, 6, 7, 8] #=> [1, 7]

Member Avatar for EvolutionFallen
0
511
Member Avatar for Dev_9
Member Avatar for Hansly

It's somewhat involved to test for checkmate. Testing for check is pretty easy. Can you write a function that tests if the king is in check? To test for checkmate you need to check if there is a way out of check: 1. can the king move to another square? …

Member Avatar for John_191
0
471
Member Avatar for jay_25

You could use the stack. Push the digits as you generate them. Then in a second loop, pop the digits and print them. You need to know when you've popped the last digit which you can either do with a counter or a sentinel value. Here's some pseudocode that uses …

Member Avatar for Carolyn_3
0
763