• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

What is he saying?

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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."
 
Joel McNary
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
"Don't believe every tiny ad you see on the internet. But this one is rock solid." - George Washington
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic