Student minValue studentdatai for int tmp i1 tmp count tmp if

Student minvalue studentdatai for int tmp i1 tmp

This preview shows page 8 - 10 out of 10 pages.

Student minValue = studentdata[i];for (int tmp = i+1; tmp < count; tmp++){if (studentdata[tmp].lastNameGet().compareToIgnoreCase(minValue.lastNameGet()) < 0){minValue = studentdata[tmp];minIndex = tmp;}if (studentdata[tmp].lastNameGet().compareToIgnoreCase(minValue.lastNameGet()) == 0){if (studentdata[tmp].firstNameGet().compareToIgnoreCase(minValue.firstNameGet()) < 0){minValue = studentdata[tmp];minIndex = tmp;}}}Student tempValue = studentdata[i];studentdata[i] = studentdata[minIndex];studentdata[minIndex] = tempValue;}for(i=0; i<student.total; i++) {System.out.println();studentdata[i].Option3_Part1_OutputStudentDetails();
Background image
}System.out.println();System.out.println("*********************************************************************************");break;case 12: System.out.println("*********************************************************************************");System.out.println("Calculate and display the Standard Deviationof the set of overall marks");System.out.println();sum = 0;for (i=0; i<student.total; i++){ sum = sum + studentdata[i].Option3_Part3_ReturnOverallMark();}average = sum/student.total; double temp = 0;for (i=0; i < student.total; i++) { double temp2 = Math.pow(average - studentdata[i].Option3_Part3_ReturnOverallMark(), 2); temp = temp + temp2; } double stdDev = Math.sqrt(temp / student.total); System.out.println("The Standard Deviation of the set of overallmarks in the unit:");System.out.printf("%4.2f",stdDev);System.out.println();System.out.println();System.out.println("*********************************************************************************");break;case 13:System.out.println("*********************************************************************************");System.out.println();for (i=0; i<studentdata.length-1; i++){ for (int k=i+1; k < studentdata.length; k++){String firstName2 = studentdata[k].firstNameGet(); // problem in this lineString lastName2 = studentdata[k].lastNameGet();int day2 = studentdata[k].dayGet();int month2 = studentdata[k].monthGet();
Background image
int year2 = studentdata[k].yearGet();long studentID2 = studentdata[k].studentIDGet();if(studentdata[i].equals(firstName2, lastName2, day2, month2, year2, studentID2) == true){System.out.println("Student data match!");System.out.println();System.out.println("The data of this student:");studentdata[i].Option3_Part1_OutputStudentDetails();System.out.println();System.out.println("Match with the data of this student:");studentdata[k].Option3_Part1_OutputStudentDetails();System.out.println();}}}System.out.println();System.out.println("*********************************************************************************");break;}}}}
Background image

You've reached the end of your free preview.

Want to read all 10 pages?

  • One '14
  • Adrian Irvananto

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture