Answer:
#include <stdio.h>
int main()
{
float assignmentScore, averageScore, midTerm, finalTerm, totalScore;
printf("Enter first assignment score: ");
scanf("%f",&assignmentScore);
averageScore += assignmentScore;
printf("Enter second assignment score: ");
scanf("%f",&assignmentScore);
averageScore += assignmentScore;
printf("Enter third assignment score: ");
scanf("%f",&assignmentScore);
averageScore += assignmentScore;
averageScore = averageScore / 3;
printf("Enter mid term score: ");
scanf("%f",&midTerm);
printf("Enter final term score: ");
scanf("%f",&finalTerm);
totalScore = (averageScore*0.40)+(midTerm*0.30)+(finalTerm*0.30);
printf("Your total score is equal to %f\n",totalScore);
return 0;
}
Explanation:
- Declare and get the assignments score, average score, mid term, final term from the user an input.
- Calculate the average score by calculating all the scores and dividing by the total no. of assignments.
- Calculate the total score by using the following formula:
Total Score = (average assignments)*40% + (midterm)*30% + (final exam)*30%
- Lastly, display the total score on the console.