Make a program called Activity2
with a method to check whether an array of any sortable type
is sorted.
Test it with the following code:
System.out.println(isSorted(new Person[]{new Person("Alex"),
new Person("Bina"), new Person("Djenaba"), new Person("Chris")}));
System.out.println(isSorted(new Student[]{new Student("Fester"),
new Student("Gomez"), new Student("Morticia"), new Student("Pugsley"),
new Student("Wednesday")}));
Your output should be
false
true
Your grade will be based on the following rubric:
0 points: code does not compile;
or does neither activity is complete and correct;
or either activity uses methods or controls other than those required.
1 point: one of the two activities is complete and correct;
or both activities are complete and correct
but the program style is incorrect;
or both activities are mostly correct
and the style is fine.
2 points: both activities are complete and correct,
and the program uses correct style.