need hw help pls

Discussion in 'Programming General' started by exiled warrior, Nov 9, 2008.

need hw help pls
  1. Unread #1 - Nov 9, 2008 at 1:00 AM
  2. exiled warrior
    Joined:
    Apr 4, 2006
    Posts:
    585
    Referrals:
    3
    Sythe Gold:
    0

    exiled warrior Forum Addict
    Banned

    need hw help pls

    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
     
  3. Unread #2 - Nov 9, 2008 at 4:50 PM
  4. Visual Basic Matt
    Joined:
    Jan 29, 2008
    Posts:
    647
    Referrals:
    2
    Sythe Gold:
    56
    Discord Unique ID:
    223154494878253056

    Visual Basic Matt Apprentice

    need hw help pls

    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.
     
  5. Unread #3 - Nov 9, 2008 at 5:09 PM
  6. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    need hw help pls

    Teach him something, don't do it for him... :/
     
  7. Unread #4 - Nov 9, 2008 at 8:41 PM
  8. exiled warrior
    Joined:
    Apr 4, 2006
    Posts:
    585
    Referrals:
    3
    Sythe Gold:
    0

    exiled warrior Forum Addict
    Banned

    need hw help pls

    at least he aint a post count whore

    and matt pls come back i need ur help
     
  9. Unread #5 - Nov 10, 2008 at 2:04 AM
  10. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    need hw help pls

    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.
     
  11. Unread #6 - Nov 10, 2008 at 2:50 AM
  12. exiled warrior
    Joined:
    Apr 4, 2006
    Posts:
    585
    Referrals:
    3
    Sythe Gold:
    0

    exiled warrior Forum Addict
    Banned

    need hw help pls

    omg swan pls help me with this

    its driving me crazy
     
  13. Unread #7 - Nov 10, 2008 at 3:45 AM
  14. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    need hw help pls

    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?
     
  15. Unread #8 - Nov 10, 2008 at 4:41 AM
  16. exiled warrior
    Joined:
    Apr 4, 2006
    Posts:
    585
    Referrals:
    3
    Sythe Gold:
    0

    exiled warrior Forum Addict
    Banned

    need hw help pls

    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
     
  17. Unread #9 - Nov 10, 2008 at 6:40 AM
  18. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    need hw help pls

    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.
     
  19. Unread #10 - Nov 10, 2008 at 10:10 AM
  20. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    need hw help pls

< help | screen shot taker >

Users viewing this thread
1 guest


 
 
Adblock breaks this site