Win a copy of Functional Reactive Programming this week in the Other Languages forum!

# What is he saying?

Jem Edwards
Greenhorn
Posts: 22
My internet instructor gave me the following feedback on the exercise I turned in:
Double counted the first entry.
% is times 100.
His cryptic responses are killing me-I don't understand what or where my errors are. This is his second response to my question reqarding his first response when he just said: 2 reads before the do. I give up trying to get a complete answer from him.
Would someone please review my code and tell me in plain english what it is that my instructor said?
Thanks.

[ April 09, 2003: Message edited by: Jem Edwards ]
[ April 09, 2003: Message edited by: Jem Edwards ]

Layne Lund
Ranch Hand
Posts: 3061
It will definitely help if you explain what the program is supposed to do. Perhaps then I can help interpret what your instructor means.
Layne
p.s. If this is a program which you have asked questions about previously, you should keep the discussion going in the same thread. It helps keep the continuity going for those that have helped you in the past. It also helps anyone that jumps in the middle and needs to know what has been asked/answered previously.

Joel McNary
Bartender
Posts: 1840
One response at a time, working backwords here
Originally posted by Jem Edwards:
[QB]My internet instructor gave me the following feedback on the exercise I turned in:
Double counted the first entry.
% is times 100.

% is times 100: This refers to how percentages are expressed. In your code, you have

If there are 10 scores and 5 of them are As, this would print out as "Number of A's = 5 which are .5% of the scores." Obviously, 5 of 10 is not one-half of one-percent, so your code should read

which will produce the output "Number of A's = 5 which are 50% of the scores."

Joel McNary
Bartender
Posts: 1840
2 Reads before the do (an assumption of what he means):
You are reading the first scrore but not processing it into its appropriate letter grade. Try the following code:

This also has the added benefit of stopping if the first score entered is negative; you just have to take care of possible divide-by-zero errors later on.

Joel McNary
Bartender
Posts: 1840
As for Double Counting the first Entry:
I have no idea what this means. It sounds as though he thought that the first entry was being processed twice, even though I just above determined that it was not being processed at all. What's more, the math was correct (sum total of scores, etc.), it's just that the first score was not being translated into A-B-C-D-F grades and included in those percentages.

Hope that this helps.

Jem Edwards
Greenhorn
Posts: 22
Layne: Yeap - I need to remember to post what the program does. I'm sure that a big help to those that are trying to help me with my problem!
Joel: Thank you - thank you! Especially for breaking it down so I can understand it. Previously the program would say I have 5 grades but drop the first grade and put the other four remaining grades in their correct breakdown and it would give me 0 as the percentage.
Now it works! I'm going to dissect this exercise and your answers piece by piece so I can prepare for the next one and the final.