Final answer:
To solve this lab assignment, you need to write a program that calculates the average test score and letter grade for a student. The program should use two value-returning functions to calculate the average score and determine the letter grade based on the average. The only input from the user should be the five test scores.
Step-by-step explanation:
To solve this lab assignment, you need to write a program that calculates the average test score and letter grade for a student. The program should use two value-returning functions to calculate the average score and determine the letter grade based on the average. The only input from the user should be the five test scores.
Here is a step-by-step guide:
- Write a function that takes five test scores as input and returns their average. You can use the formula: average = (score1 + score2 + score3 + score4 + score5) / 5.
- Write a function that takes the average score as input and returns the corresponding letter grade. You can use a series of if-else statements to determine the grade based on the average score.
- In your main program, prompt the user to enter the five test scores.
- Call the average function with the test scores as arguments to calculate the average.
- Call the letter grade function with the average as argument to determine the grade.
- Print out the average score and the letter grade.