Skip to content
Advertisement

Tag: for-loop

confused about java looping

I just started learning programming and java is my first language. I’ve come across an exercise involving for loop, I’d like to know how the result is found: the output is: 17 I know this is a silly basic question but I really need to understand how the result is 17. Answer In your loop : the i starts at

Nested loop in RobotFramework

I need to create a nested loop in Robot framework. Can you please Help me do it? I need to have a nested loop which compares all the ${text} with all the @{lines} in the file. Thanks in Advance Answer No nested loops in RF; that can be done only by calling a keyword with the inner loop, in the

Draw an ASCII diamond in a frame

I am trying to draw out a diamond in a frame. I figured my way through the top half, but when I come to the 2nd half I had attempted to invert the loops and problems came up. I played around switching operators just to see the result, but still nothing works. Please help. What am I not seeing. Answer

CodeWars – Sum of odd Numbers – For loop

I have attempted to make a piece of code that accepts an input of “n”, calculates the sum of the numbers on the nth line an odd number triangle, which looks like: etc. So for n = 3, the sum would be 7 + 9 + 11 ie 27 I know that n is not only the line number but

Java finding minimum value from for loop

I was having some problem when trying to find the minimum distance and from the minimum distance, I then plot two circles onto the map. Currently I am getting 15, 3, 15, 14 as DIST but I could not get the minDist as it is not printed out. Any ideas? Thanks in advance. Answer You probably want: and initialize minDistance

Basic Java Hangman

I am just starting to learn Java as my first programming language. In class we were assigned to make a basic Hangman game with the use of a while and for loops. What I have so far When the user inputs the first guess it does recognize that that characters that he/she guessed was corrected but just continues on and

Advertisement