• Log in or sign up for an account here: https://www.sythe.org/login

need hw help pls

exiled warrior

Forum Addict
Joined
Apr 4, 2006
Sythe Gold
0
Messages
585
im making a program that calculates scores for a competition

the user will input 10 seperate scores and my program will calculate an average score dropping the highest score and the lowest score and the program will calculate the score as the average of the 8 middle scores ( note the user can input the scores in any order and im thinking i need to use repitition to do this)

first my program needs to locate the highest and lowest score and get rid of them then it needs to add the 8 middle scores together and divide that by 8 for the average

so how do i go about making my program find the lowest and highest score

pls keep it as simple as possible, im new to vb


thx in advance for the help
 
Hold on, whippen up a code for you.

Edit: Sorry g2g but this is kinda what you need.

Use arrays for your textboxes and run a repeat like...

Code:
if textbox(Array) >= textbox((Array) + 1) then

Or you can use cases, I don't care how you do it, but just get the drill and you'll be fine.
 
Teach him something, don't do it for him... :/

at least he aint a post count whore

and matt pls come back i need ur help
 
Member of the Month Winner
Sythe's 10th Anniversary
at least he aint a post count whore

and matt pls come back i need ur help
What are you talking about? I agree with him.

You won't learn if you leech. Leastways not much. I generally tell people how to do it, but leave them to write the code. That is the best way to learn if you're stuck, and you do actually LEARN.
 
omg swan pls help me with this

its driving me crazy
 
Member of the Month Winner
Sythe's 10th Anniversary
omg swan pls help me with this

its driving me crazy
I would normally use Console applications for this, as it in no way requires Windows Forms.

First, you need to loop for the user to input the scores in to an array of integers (or doubles, depending on whether or not you want decimals). Ideally, you would use a 'for' loop.

Then you need to sort your array from smallest to largest, and take out the two end values. To do this, there are multiple ways. The simplest being the "bubble sort". More information on Bubble Sort here: http://en.wikipedia.org/wiki/Bubble_sort

I take it you know how to do basic arithmetic?
 
lol can u jus do it for me

at least show me some code so i get the drift

the link didnt help

there has to b a simple way to eliminate the highest and lowest score
 
Member of the Month Winner
Sythe's 10th Anniversary
lol can u jus do it for me

at least show me some code so i get the drift

the link didnt help

there has to b a simple way to eliminate the highest and lowest score
No. I'm not going to write the code for you because otherwise you just won't learn.

Luckily for you, Microsoft .Net's Array class provides a suitable method for sorting.

I'll give you the following piece of code, and that is it:
Code:
System.Array.Sort(Items)

Where 'Items' is the array of numbers you are using.
 
Runescape Gamblingrunescape gambling
Back
Top