$50.00 Exam Score Statistics Computations (missing sorting)
- This tutorial hasn't been purchased yet.
- Posted on Dec. 06, 2008 at 12:53:24AM
A:
Preview: ... totals, averages, high, etc. ...
The full tutorial is about 19 words long plus attachments.
Attachments:
ScoreStats.java (4K) (Preview)
$37.00 All except fun4, NetBeans folder zipped, screen shots, java files, use notes,
- This tutorial hasn't been purchased yet.
- Posted on Dec 06, 2008 at 1:45:01PM
A:
Preview: ... res[student][test] < 70) {<br> under70++;<br> }<br><br> }// end test loop<br> scores[student][5] = col5;<br> scores[student][6] = col6;<br> scores[student][7] = col7;<br><br> }// end student loop<br><br> return under70;<br> }// end fun1()<br>//*****<br> String fun2(int[][] scores, float[] averagearray, String[] namesarray) {<br> float highAve = 0;<br> int highIndex = -999;<br> for (int stud = 0; stud < scores.length; stud++) {<br><br> float sum = 0;<br> for (int test = 0; test < 5; test++) {<br> sum += scores[stud][test];<br> }// end for test<br><br> averagearray[stud] = (float) (sum / 5.0);<br> if (highAve < averagearray[stud]) {<br> highAve = averagearray[stud];<br> highIndex = stud;<br> }// end if highAve<br> }// end for stud <br><br> return (new String(namesarray[highIndex]));<br><br> }// end fun2()<br>//*****<br> float fun3(String[] namesarray, int[][] scores, float[] averagearray) {<br>// sort by averages, high to low:<br>// I think that this is called a bubble sort:<br><br> int sum = 0;<br> for (int k = 0; k < 4; k++) {<br><br> for (int j = k + 1; j < 5; j++) {<br> if (averagearray[j] > averagearray[k]) {<br> float temp = averagearray[k];<br> averagearray[k] = averagearray[j];<br> averagearray[j] = temp;<br> // }<br><br> for (int m = 0; m < 8; m++) {<br> int temp2 = scores[k][m];<br> scores[k][m] = scores[j][m];<br> scores[j][m] = temp2;<br> }<br> String tempStr = new String(namesarray[k]);<br> namesarray[k] = new String(namesarray[j]);<br> namesarray[j] = new String(tempStr);<br> ...
The full tutorial is about 3432 words long plus attachments.
Attachments:
JavaArrays.zip (50K)
Program4.java (5K) (Preview)
Letter_grade.java (0K) (Preview)
ConsoleOutput.JPG (35K) (Preview)