Hello,
I am trying to create a program using C where the user enters a desired grade (A, B, C) , along with the minimum average needed for that grade (90%, 80%, 70%), their current average, and how much the final counts as a percentage of the course grade (25%).
The program should output:
You need a score of ... on the final to get a ...
Currently, I am getting a error that says "expected expression before '%' token on the line where it says grade_calc =
This is what I have so far and my new function is giving me a headache with new debugging problems. If someone could help me fix my current problem and give me a nudge in the right direction as to what to do I would greatly appreciate it.
insertCode:#include <stdio.h> int main() { char grade[5]; float minimumavg[5]; float currentavg[5]; float finaltest[5]; float newgrade [5]; printf("Enter desired grade: \n"); scanf(" %c", grade); printf("Enter minimum average required: \n"); scanf("%f", &minimumavg); printf("Enter current average in course: \n"); scanf("%f", ¤tavg); printf("Enter how much the final accounts for as a percentage: \n"); scanf("%f", &finaltest); printf("You need a score of %f on the final to get a % c" , &newgrade, &grade); double grading(double x, float currentavg, float finaltest) { double grade_calc; grade_calc = %f * x + (1 - %f) * %f , &finaltest, &finaltest, ¤tavg; return (grade_calc); }