FIX THE ERRORS FOR THE FOLLOWING PROGRAMS PLEASE ONE // provides an ascending so
ID: 3722347 • Letter: F
Question
FIX THE ERRORS FOR THE FOLLOWING PROGRAMS PLEASE
ONE
// provides an ascending sort
public class AscendingSort extends Sorting {
@Override
protected boolean boolNeedEcchange(int[] nArray, int first, int second) {
boolean needExchange = false;
if(first<second) {
needExchange = true;
}
return needExchange;
}
}
TWO
// provides a descendingSort
public class DescendingSort extends Sorting {
@Override
protected boolean boolNeedExchange(int[] nArray, int first, int second) {
boolean needExchange = false;
if(first<second) {
needExchange = true;
}
return needExchange;
}
}
Explanation / Answer
the main problem in AscendingSort file if condition --------- if( first< second) less than symbol this is wrong
correct right condition is--------------- if( first > second) greater than symbol
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.