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 static void main(String[] args) {
int values[] = new int[5];
int z;
for (int i = 0; i<5; i++){
values[i]=Integer.parseInt(JOptionPane.showInputDialog("Ent er Int
value"));
}
for (int p = 0; p<4; p++){
for (int q=(p+1); q<5; q++) {
if (values[q]<values[p]){
z=values[q];
values[q]=values[p];
values[p]=z;
}
}
}
for (int i = 0; i<5; i++){
System.out.println(values[i]);
}
}
}
Presuming that you have identified the purpose of the above code, and how its algorithm operates, write a brief specification of the method.
Now assume that you are an independent tester of software, and have only been given the specification of that method, and that you have to “fully” test it as an independent method.
Could you think of a set of test cases (i.e. more than just one) which you would need to develop to
do this? Key to developing a set of test cases is to think of any “special cases” of the input data which might not be “picked up” due to “slight” errors in the development of the algorithm used by the programmer.