void main(){ int grades[] = {88, 67, 94, 100, 56, 43, 79, 77}; int count = 0; int sum = 0; int index = 0; int current_grade = 0; int high_grade = 0; int low_grade = 100; float average = 0.0; /***** Example 1, find highest grade *****/ // loop through all grades for(index = 0; index < _array_size(grades); index++){ // get the current grade current_grade = grades[index]; // test if we found a higher grade if( current_grade > high_grade ){ high_grade = current_grade; } } // display the highest grade printf("highest grade is %d\n", high_grade); /***** Example 2, find lowest grade *****/ // loop through all grades for(index = 0; index < _array_size(grades); index++){ // get the current grade current_grade = grades[index]; // test if we found a lower grade if( current_grade < low_grade ){ low_grade = current_grade; } } // display lowest grade printf("lowest grade is %d\n", low_grade); /***** Exercise 1, find the sum of all grades *****/ // Hint: loop through all grades and keep a running total // display the sum of all grades printf("sum of all grades %d\n", sum); /***** Exercise 2, find the average of all grades *****/ // Hint: you need the sum from exercise 1 // display the average grade printf("grade average is %f\n", average); /***** Exercise 3, count the number of passing grades (60 or better) *****/ // display the count of passing grades printf("count: %d\n", count); }