Code:
//This programs prompts the user for the grades of ten tests, then prints the av
erage score, the high score, and a list of scores associated with each student a
nd test, including a letter grade.
#include <stdio.h>
float findLowest(float grades[], int n)
{
int i, int n=10;
float low=100.0;
for (i=0;i<n;i++)
if (grades[i] < low) low = grades[i];
return low;
}
float findHighest(float grades(), int n)
{
int i, int n=10;
float high = 0.0;
for(i=0;i<n;i++)
if (grades[i] > high) high = grades[i];
return high;
}
#define N 10
int main(void)
{
double grade[N], highscore, average_score;
int i, numraise;
float sum, studentname;
char lettergrade;
highscore=0.0;
sum=0.0;
average_score= sum/10;
printf("Enter %d grades: ", N); //Prompts the user for grade inputs
for (i=0; i<N; i++)
{
scanf("%lf", &grade[i]);
sum += grade[i];
}
for (i = 0;i < 10; i++)
{
if (grade[i] >= 90.0)
lettergrade='A';
else if (grade[i] >=80.0)
lettergrade='B';
else if (grade[i] >=70.0)
lettergrade='C';
else if (grade[i] >=60.0)
lettergrade='D';
else
lettergrade='F';
printf("Student %d's grade is %.1lf, this is an %c\n", i+1, grade[i], lettergra
de);
}
//printf("The highest score is %.1lf\n", highscore); //Prints high score
printf("the average score is %.2lf\n", average_score); //prints average
printf("The lowest score is: %.2f", findHighest(grades, n));
printf("The highest score is: %.2f", findLowest(grades, n));
return 0;
}
Almost done, gonna compile