# Thread: test scores

1. ## test scores

ok, don't mean to be long but i need help with a program and i want to give all the necessary information. I have coded the program however, am having problems with it. Here is the program:

Write a program that accepts a student identification number and three test scores, test1, test2, and final_test, as input and then determine outputs for each student the semester average and the final letter grade according to the following scheme:

Semester Average Final Letter Grade
90-100 A
80-89 B
70-79 C
60-69 D
0-59 F

The semester average for students is computed using the following formula: semester_average =0.2.*test1+0.30*test2+0.50*final_test

students identification numbers are nonzero integers. Input should terminate when the instructor types 0 for student identification number. The instructor also wants a distribution of letter grades and a class average. Class average is computed using the following formula:
clas_average=(4* number_of_A_grades +3*number_of_B_gardes+2*number_of_C_grades+1*numbe r_of_D_grades)/number_of_students. This is all the required information now here is my code and as always thanks for all the help!!!!!!!!!!!!!!!!!!!

#include <stdio.h>

int main (void) {
/* Variable declarations: */

/* Function body: */

printf ( "A program that prints letter grades\n");
printf ( "Enter grade\n");
scanf ( "%1f", &grade);

if (grade >= 90)
printf ( "Grade = 'A' ");

else if (grade >= 80)
printf ( "Grade = 'B'");

else if (grade >= 70)
printf ( "Grade = 'C'");

else if (grade >= 60)
printf ( "Grade = 'D'");

else
printf ( "Grade = 'F'");

/* end if*/

} /* end function main*/

Sample program design according to the book:
****> Enter student idno: 1100
****> Enter test score 1: 70
****> Enter test socre 2: 80
****> Enter final score: 100
Semester average for student 1100: 88
Letter grade for student 1100 : B

****> Enter studnt idno: 1200
****> Enter test socre 1: 75
****> Enter test score 2: 65
****> Enter final score: 76
Semester averag for student 1200: 73
Letter grade for student 1200 : C

****> Enter student idno: 0
A 4
B 6
C 7
D 2
F 0

Class Average: 2.63

2. ## ...

ok, don't mean to be long but i need help with a program and i want to give all the necessary information. I have coded the program however, am having problems with it.
What are these problems you are having?

biterman.

3. biteman why is that? If I have done anything wrong then forgive me and look over my post. Just tring to seek help not to break any law or anything! Since yo asked, the problem I was havein was with codeing the studnet number and getting the program to look like the output, but please don't respond I will continue to read and seek help else where. Again thanks for the help.

Also, biteman, well never mind, again thanks!

4. ## ...

Why is what?

I was just trying to help. But in order for me to able to do that you need to ask more specific questions.
Since yo asked, the problem I was havein was with codeing the studnet number and getting the program to look like the output
Well think about it...

1. You have to keep asking for StudentID's and grades until input is 0.
2. You have to keep count of the number of instances of each letter grade.
3. You have to calculate the semester avg of each student and it's respective letter grade.
4. Print the info gathered on step 2.
5. You have to calculate the class avg, for this you'll use the info you got in step 2.

The way you phrased your questions gave the impression that you basically wanted someone to do the exercise for you.

Think about in the terms i mentioned above, then try to solve each step. I think that should help.

I think that's pretty much all i can do for you, short of writing it for you.

Hope it helps...