Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please write a the main() function for a program that uses the three functions f

ID: 3575186 • Letter: P

Question

Please write a the main() function for a program that uses the three functions from the previous question to display the student's letter grade in the class.

PREVIOUS QUESTION

Your Glorious Instructor asks you to write a program that computes the letter grade for a student taking their course. The professor assigns up to 10 assignments and drops the lowest test score.

Write functions that do the following: THESE ARE THE 3 MAIN FUNCTIONS

A function called getTestScores that has two parameters: an array of doubles containing the test scores and an integer that says how many tests were assigned. This function needs to a have a void return type and should loop through the array asking the user to enter each test score.

A function called findLowestIndex that has two parameters: an array of doubles containing the test scores and an integer that says how many tests were assigned. This function should return an integer containing the index of the lowest test score in the array.

A function called computeAverage that has two parameters: an array of doubles containing the test scores and an integer that says how many tests were assigned. This function should loop through the array to compute an average and return this double to calling function.

Explanation / Answer

void main() {

   double d[10], avg;
   int lowest;
   int num_tests;

   getTestScores(d, &num_tests);

   lowest = findLowestIndex(d, num_tests);

   avg = computeAverage(d, num_tests);
  
   printf(" Average = %lf ", avg);
}