aspose file tools*
The moose likes Beginning Java and the fly likes What is he saying? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What is he saying?" Watch "What is he saying?" New topic
Author

What is he saying?

Jem Edwards
Greenhorn

Joined: Mar 28, 2003
Posts: 22
My internet instructor gave me the following feedback on the exercise I turned in:
2 reads before the do.
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

Joined: Dec 06, 2001
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.


Java API Documentation
The Java Tutorial
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1821

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:
2 reads before the do.
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."


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1821

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

Joined: Aug 20, 2001
Posts: 1821

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

Joined: Mar 28, 2003
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What is he saying?