# c++ grade program



## Horace (Mar 3, 2004)

hey i've been trying to create a program that will read a students name together with his or her test scores from a file i called grades.dat 
Well after i did that i ran into problems I tried to use a void function to determine the average for the five test scores i had for each student and then i had a loop to read the five test score and get a sum for them. For some reason this is not working at all it's not coming up i try to make a return value function but i just get a bunch of errors.
I need the program to output somthing like the following:

Student# Test1 Test2 Test3 Test4 Test5 Average 
A 75 83 77 91 76 80.40 B
B 80 90 95 93 48 81.20 B
C 78 81 11 90 73 66.60 D
D 92 83 30 69 87 72.20 C
E 23 45 96 38 59 52.20 F
F 60 85 45 39 67 59.20 F
G 27 31 52 74 83 53.40 F

Class Average = 66.46
Percentage of A's: 0.00
Percentage of B's: 0.29
Percentage of C's: 0.14

I would really appreciate if someone could give me someidea what to do after i use the loop to read the test scores and get the sum


----------



## Guy (Feb 19, 1999)

1. Show us some code. We can not help you with your code if we dont know what it is.
2. Explain in detail the error. ie. What was input into the function? what did you get returned? what did you expect to get returned?
3. We dont DO homework. but we can HELP with homework if you get stuck on specific problems.
4. Welcome to TSG

Now regarding your problem.
Are you positive that the values you read in from the file are valid when they are in their storage variable? ie. array or vector
To output text to a console screen look up the *std::cout* operator that resides in the header <iostream>

Good Luck


----------



## AlbertB (Nov 24, 2002)

Hello Horace?

Any movement forward with your problem. Some of us are waiting here for you to post a snippet of your current code then we can come in on things with help! We want to be sure you have the first part functioning before we go ahead with the second.


----------



## Snake~eyes (Apr 18, 2002)

I guess he deson't want muhc help


----------

