Page 1 of 1

## 4 Replies - 1538 Views - Last Post: 05 June 2011 - 05:21 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=234669&amp;s=9984ad47ecd14c4c2322019be5ecdff3&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 wolflight26

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

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

• Critical Section

Reputation: 1822
• 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

### #3 Martyr2

• Programming Theoretician

Reputation: 4930
• Posts: 13,326
• 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.

### #4 trevster344

• The Peasant

Reputation: 224
• Posts: 1,519
• 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.

### #5 wolflight26

Reputation: 0
• 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.