• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

BrokenProgram dont know what i did wrong

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Its a grade calculator, It compiles and runs but the only grade it outputs is an F. This is my entire main method. It seems to me like it should work. But I dont know, if i change averageScore to scoreAccumulator, i get it to output an A but no other scores, Also it grades after the first score is entered. Cant figure out where the problem is.
 
Marshal
Posts: 28296
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you consider finding out what the value of the averageScore variable is when you try to figure out the grade level? (Hint: print it out and look at what gets printed.) My prediction is that the value is zero, since I don't see any code which assigns it a value anywhere in your post, but obviously there's other code you haven't posted because I don't see a declaration for averageScore.
 
John Beese
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oh duh, i had it declared as. averageScore = scoreAccumulator. not averageScore = scoreAccumulator / numberOfItems.

Thanks.
 
There's a city wid manhunt for this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic