Flowchart:
[Start] -> Module main -> Module getScores -> Function determineGrade -> Function calcAverage -> [End]
Pseudo-code:
1. Module main:
- Call getScores function
2. Module getScores:
- Initialize totalScore to 0
- Initialize scores array to store 5 test scores
- Loop 5 times:
- Ask user to enter a test score
- Call determineGrade function to get the letter grade
- Add the score to totalScore
- Call calcAverage function with totalScore
3. Function calcAverage:
- Accept totalScore as input
- Calculate average by dividing totalScore by 5
- Return the average
4. Function determineGrade:
- Accept test score as input
- Determine the letter grade based on the grading scale
- Return the letter grade as a string
Program Coded:
```c
#include <stdio.h>
char determineGrade(int score) {
if (score >= 90) {
return 'A';
} else if (score >= 80) {
return 'B';
} else if (score >= 70) {
return 'C';
} else if (score >= 60) {
return 'D';
} else {
return 'F';
}
}
float calcAverage(int totalScore) {
return totalScore / 5.0;
}
int main() {
int totalScore = 0;
int scores[5];
for (int i = 0; i < 5; i++) {
printf("Enter grade for test %d: ", i + 1);
scanf("%d", &scores[i]);
totalScore += scores[i];
printf("The grade for test %d is %c
", i + 1, determineGrade(scores[i]));
}
printf("The average of the test scores is: %.1f
", calcAverage(totalScore));
return 0;
}
```
Program Output:
Please enter 5 test scores to receive their letter grades and average of the 5 scores.
Enter grade for test 1: 90
The grade for test 1 is A
Enter grade for test 2: 80
The grade for test 2 is B
Enter grade for test 3: 70
The grade for test 3 is C
Enter grade for test 4: 60
The grade for test 4 is D
Enter grade for test 5: 50
The grade for test 5 is F
The average of the test scores is: 70.0