Class 21:
public static double[] greaterThanZeroOnly(double[] list) {
int count = 0;
double[] newList;
for (int i=0; i<list.length; i++)
if (list[i] > 0)
count++;
newList = new double[count];
count = 0;
for (int i=0; i<list.length; i++)
if (list[i] > 0) {
newList[count] = list[i];
count++;
}
return newList;
}
public static void printFirstBeginsWithVowel(ArrayListlist) { String vowels = "aeiouAEIOU"; String thisOne; for (int i=0; i<list.size(); i++) { thisOne = list.get(i); if ((thisOne.length() > 0) && (vowels.indexOf(thisOne.charAt(0)) != -1)) { System.out.println(thisOne); return; } } }