4 Replies - 1296 Views - Last Post: 05 June 2011 - 05:21 PM Rate Topic: -----

#1 wolflight26  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-June 11

Averaging 15 user-input grades and then telling the letter grade

Posted 05 June 2011 - 02:41 PM

I'm really confused on where to start on a program I'm supposed to build. It is meant to average 15 user-input grades and then from there I have to provide the letter grade that corresponds with the average percent. I understand how to provide the corresponding letter grade, but I don't understand how to get the average. I've tried putting it into arraylist format, but I'm getting myself confused.

I'm a new programmer, with a teacher who won't answer my e-mails. If someone could steer me in the right direction, it would be amazing!

Thank you!

Is This A Good Question/Topic? 0
  • +

Replies To: Averaging 15 user-input grades and then telling the letter grade

#2 smohd  Icon User is offline

  • Critical Section
  • member icon


Reputation: 1820
  • View blog
  • Posts: 4,627
  • Joined: 14-March 10

Re: Averaging 15 user-input grades and then telling the letter grade

Posted 05 June 2011 - 03:35 PM

Get 15 inputs from user, you can store them into array then sum them all and divide the sum by 15, then this is the average of 15 inputs
Was This Post Helpful? 1
  • +
  • -

#3 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4425
  • View blog
  • Posts: 12,293
  • Joined: 18-April 07

Re: Averaging 15 user-input grades and then telling the letter grade

Posted 05 June 2011 - 03:37 PM

How do you figure out an average? Uhhh... sum up the 15 values and divide by 15 perhaps? So create a loop that asks the user for a score 15 times. On each pass add it to a running total. After the loop is done, divide that total by 15 to get an average.

:)
Was This Post Helpful? 1
  • +
  • -

#4 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,511
  • Joined: 16-March 11

Re: Averaging 15 user-input grades and then telling the letter grade

Posted 05 June 2011 - 04:00 PM

You'll want to refresh yourself on the mean, or average it's really not complex at all. Good way is to loop through a block of code asking for input, you'll want to keep track of the count, and then perform the simple arithmetic when your count reaches 15. Simple. :)
Was This Post Helpful? 1
  • +
  • -

#5 wolflight26  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-June 11

Re: Averaging 15 user-input grades and then telling the letter grade

Posted 05 June 2011 - 05:21 PM

Thank you all for your help! I don't know why I didn't think to loop it in the first place, it seems so obvious now.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1