This is what i got well at the end of the for, for And if loop is that correct before I go on to do the last bit
Type: Posts; User: amb101293
This is what i got well at the end of the for, for And if loop is that correct before I go on to do the last bit
would the final answer after the loops have ran all 4 times that the array is as follows if the 5 values entered is : 7, 12, 2, 10, 21
would the answer be
7, 2, 10, 12, 21
p - 0
q - 1
values[p] - 7
values[q] - 12
the code that i posted is the only code i have for this question
is it right then that the first time that the loops go through that it is as follows
for(int p=0; p<4; p++){
for(int q=0+1(1); q<5; q++){
if(values[q] < values[p])
//If...
in the if statement where does the values[q] and values [p] come from
where would i start. with the if statement then work out to the inner for then the outer?
i only have the values when it asks the user to enter values and puts them in the array as i cant seem to follow the loops. the values i have there are 7, 4, 10, 1 ,19
i knew that the first part asks for them to enter 5 numbers and puts them into the arrays its the next part that i cant follow as i dont really know where to start
i cant seem to follow the loop through would you be able to help me
This is a exercise to practice desk checking so dont say to run it.
I cant follow through the loops
can someone please help me
import javax.swing.JOptionPane;
public class Main {
public...