I’m working on case 3 and I need to print some details about the 3 instances for the Airplane class and the BatMobile class. The loop only prints out elements at index 1 and 2 and the other 3 …
Tag: for-loop
Validating elements of a 2D array
My code for making sure an element isn’t over 100 or less than 0 is: Except no matter what the input is the answer is always true My input array is test should = false if I input this no? College rules mean I cannot use break; or return anywhere other than the end of the sub module. Answer You
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
How to output an ASCII star patterns in a table format?
I need help with my code issue. I have to write a program that displays a star pattern in a table format. I am not exactly looking for the exact code, I would like to figure it out myself, so any suggestions and tips would be greatly helped. Answer Since you said you don’t want a full solution, here are
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
Why does my for loop only return first value in JTable?
So I’m using this for loop to go through the values held in the first column. Then the if statement deletes the row if the value entered by the user is equal to the the value held in String hold. I am able to delete the first row but can not delete any row after that. What am I doing
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