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

Page 1 of 1

## 4 Replies - 1475 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=a59b4a198eeaf808d44347b80b233512&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 wolflight26

• New D.I.C Head

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

• Critical Section

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

• Programming Theoretician

Reputation: 4862
• Posts: 13,178
• 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

• The Peasant

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

• New D.I.C Head

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.
Was This Post Helpful? 0

Page 1 of 1

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }