Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Solved

Posted on 2013-06-24

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:

if answer>100 and answer < 200)

DO THIS, BRANCH #1

if answer >200 and answer<300

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.

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:

if answer>100 and answer < 200)

DO THIS, BRANCH #1

if answer >200 and answer<300

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.

2 Comments

97+97+97+97+97+97=582

the largest possible sum would be

122+122+122+122+122+122=73

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)

582-639

640-649

650-657

658-665

666-675

676-732

I attached the spreadsheet where I made the calculations for reference.

Permutations.xls

Question has a verified solution.

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

Title | # Comments | Views | Activity |
---|---|---|---|

find distance using springs and slopes | 23 | 157 | |

Binomial distribution | 2 | 55 | |

Word Problem | 4 | 81 | |

Triangle - computing angles | 3 | 50 |

Join the community of 500,000 technology professionals and ask your questions.