Solved

Finding an array of averages ?? Newbie here

Posted on 2013-06-24
242 Views
I am writing a program that a decision needs to be made, and I need help with.

I have a range of numbers ( actually ASCII values ) from:

97 to 122 ( representing a-z )

The user will be entering six (6) letters as an answer.

Somehow, I need SIX branches of decisions to be made based upon the sum of their answer.

Here is my pseudocode ( remember I need 6 branches ) - and my pseudocode will be using low, wrong numbers just for example:

DO THIS, BRANCH #1

DO THIS, BRANCH #2

etc.

I dont know how to take the six characters entered ( adding up their AsCII values ) and determine how to break it up into six branches! I would like the branches to be equal in their span, but they don't have to be.

Can someone help me in determining the six branchevalues???

Thank you.
0
Question by:edvinson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 84

Accepted Solution

ozo earned 250 total points
ID: 39270793
If you are adding together 6 numbers from 97 to 122, the smallest possible sum would be
97+97+97+97+97+97=582
the largest possible sum would be
122+122+122+122+122+122=732
the difference, 732-582 =150 (for 151 distinct possible sums)
dividing that into 6 approximately equal spans 150/6=25
(but there will be more ways of generating sums in the middle spans than in the end spans)
0

LVL 37

Assisted Solution

TommySzalapski earned 250 total points
ID: 39271139
If you want an equal number of possibilities (well, there's some rounding) in each bucket, then the buckets should be split as follows:
582-639
640-649
650-657
658-665
666-675
676-732

Permutations.xls
0

Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to Win a Jar of Candy Corn: A Scientific Approach! I love mathematics. If you love mathematics also, you may enjoy this tip on how to use math to win your own jar of candy corn and to impress your friends. As I said, I love math, but I gu…
This article provides a brief introduction to tissue engineering, the process by which organs can be grown artificially. It covers the problems with organ transplants, the tissue engineering process, and the current successes and problems of the tec…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Suggested Courses
Course of the Month4 days, 3 hours left to enroll