some parts of the code is incorrect
0. i have never seem the do {}... while () writen like that what i've seem is:
Code:
do {
statements;
}
while (condition) ;
1. to print a string use %s conversion specification (not %d) and don't place the ampersand (&) infront of the variable in the parameter list. below is a working version.
Code:
printf("Please enter test score 1 for student %s.\n", studnam);
2. ampersand (&) missing infront of the variable names in the scanf functions. below is a working version.
Code:
scanf("%d", &score1);
3. average grade print out should have else before the if after the first if - confused look at code below and need to reformat the condition with the && operator. below is a working version. copy and paste if you must.
Code:
if (average < 60) printf("grade is 'F'\n.");
else if (average > 59 && average < 70) printf ("grade is 'D'.\n");
else if (average > 69 && average < 80) printf("grade is 'C'.\n");
else if (average > 79 && average < 90) printf("grade is 'B'.\n");
else if (average > 89 && average < 101) printf("grade is 'A'\n");
4. the code :
Code:
printf("1: Print Report");
printf("2: Exit Program");
should go after
Code:
printf("Would you like to print the entered informaion?");
but before the scanf function.
4. print report has similar error to above, the extra semicolon should be removed too.
Code:
if (prtrep == 2) printf("then print file grades record.\n");
else if (prtrep == 1) printf("Hit enter to exit program now.\n");
\n needs to be used in some other places and really no need for the extra braces
good luck, hope i haven't made any mistakes in my code and language.
i'm new to c aswell.