Results 1 to 14 of 14

Thread: Urgent need help please!

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2011
    Posts
    7

    Question Urgent need help please!

    Problem 4
    Create an application that will allow a teacher to enter the scores for each student in their class and then display the scores in rank order (name and score for each student)
    The program should follow the following steps:
    1. Set the number of students in an array
    2. Ask the user for the Score for each student
    3. Sort the scores into rank order
    4. Display the Scores for each student in order
    Name you application Task5Sort
    Hint: Bubblesort (http://support.microsoft.com/default...b;en-us;133135)

    Problem 5
    Create an application that will read in a list of names and then display the names in a random order. The Fisher-Yates shuffle uses the following algorithm to sort a set of data into a random order in such a way that each different order is equally possible. You can use this, or another shuffle algorithm that you find on Google.
    The program should follow the following steps:
    1. Input a number of names into an array
    2. Have the values in the array arranged in a random order.
    3. Output the names onto a label.
    Fisher-Yates shuffle: http://en.wikipedia.org/wiki/Fisher%...3Yates_shuffle
    Name your application Task5Shuffle

    Can ANYONE AT ALL HELP ME WITH THIS, I AM STRUGGLING A WHOLE LOT, ANY HELP WOULD BE APPRECIATED, THANKS!

  2. #2
    Hyperactive Member
    Join Date
    Jun 2009
    Posts
    441

    Re: Urgent need help please!

    What kind of help exactly do you need ? it's very easy to do this, can you be clear about the help that you need ?

    Do you need to create an interface ? Should you store the values in a file ? or just in a list box ?

    you can simply create 2 text boxes with a button add and a list box


    first textbox, the user fills it with the student name and the second with it's score, each time you click on add, it will add these values to an array in memory and once finish, you sort the array and display the result in the listbox

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Urgent need help please!

    Quote Originally Posted by Mage0wnz216 View Post
    Problem 4
    Create an application that will allow a teacher to enter the scores for each student in their class and then display the scores in rank order (name and score for each student)
    The program should follow the following steps:
    1. Set the number of students in an array
    2. Ask the user for the Score for each student
    3. Sort the scores into rank order
    4. Display the Scores for each student in order
    Name you application Task5Sort
    Hint: Bubblesort (http://support.microsoft.com/default...b;en-us;133135)

    Problem 5
    Create an application that will read in a list of names and then display the names in a random order. The Fisher-Yates shuffle uses the following algorithm to sort a set of data into a random order in such a way that each different order is equally possible. You can use this, or another shuffle algorithm that you find on Google.
    The program should follow the following steps:
    1. Input a number of names into an array
    2. Have the values in the array arranged in a random order.
    3. Output the names onto a label.
    Fisher-Yates shuffle: http://en.wikipedia.org/wiki/Fisher%...3Yates_shuffle
    Name your application Task5Shuffle

    Can ANYONE AT ALL HELP ME WITH THIS, I AM STRUGGLING A WHOLE LOT, ANY HELP WOULD BE APPRECIATED, THANKS!
    We won't do your homework for you but if you show us what you have so far, we'll try to help.

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2011
    Posts
    7

    Re: Urgent need help please!

    I have gotten to step 2 on both, and i am allowed to use text boxes, labels or msgboxes. Furthermore, I have struggled with this for ages, i've done everything in a button so yeah. Any ideas?

  5. #5
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Urgent need help please!

    Quote Originally Posted by Mage0wnz216 View Post
    I have gotten to step 2 on both, and i am allowed to use text boxes, labels or msgboxes. Furthermore, I have struggled with this for ages, i've done everything in a button so yeah. Any ideas?
    Hello,

    I am fairly sure that Marty was referring to you actually showing the code that you currently have to date, not just "saying" what you have done.

    Gary

  6. #6

    Thread Starter
    New Member
    Join Date
    Aug 2011
    Posts
    7

    Smile Re: Urgent need help please!

    Hi guys, this is my code so far

    Private Sub CommandButton1_Click()
    'Declares variables as either integers or strings.
    'Variables with the () are arrays with undefined array lengths.
    Dim StudentsNum() As Integer
    Dim StudentsName() As String
    Dim Number As Integer
    Dim Name As String
    Dim Score As Integer
    Dim Counter As Integer
    Dim Result As String
    Dim i, j As Integer

    'Makes the textboxes have no writing in them.
    TextBox1.Text = Clear
    TextBox2.Text = Clear

    'Asks you to input the number of students in the class.
    Number = InputBox("How many students are in your class?")

    'Redeclares the variables so that they have a defined array length.
    ReDim StudentsNum(Number)
    ReDim StudentsName(Number)

    'Lets you enter the names and scores for each student.
    For Counter = 1 To Number
    StudentsName(Counter) = InputBox("What is the students name?")
    StudentsNum(Counter) = InputBox("As a percentage, what is the students score?")
    Next


    What is the next step in ordering the array and printing the results? D:

  7. #7
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Urgent need help please!

    Before we go any further, let me ask you if you are sure you are using VB6 rather than a version of VB.Net (Visual Studio). I ask because the sort example your teacher gave you was not VB6.

  8. #8
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Urgent need help please!

    Quote Originally Posted by MartinLiss View Post
    Before we go any further, let me ask you if you are sure you are using VB6 rather than a version of VB.Net (Visual Studio). I ask because the sort example your teacher gave you was not VB6.
    If you are talking about the Bubblesort code, then it's VBA ! Isn't it ?


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  9. #9

  10. #10
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Urgent need help please!

    Quote Originally Posted by akhileshbc View Post
    If you are talking about the Bubblesort code, then it's VBA ! Isn't it ?
    The control names are an indicator. VB6 doesn't use those types of names except for Forms2 library. Appears this may be a .Net homework assignment
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  11. #11

    Thread Starter
    New Member
    Join Date
    Aug 2011
    Posts
    7

    Smile Re: Urgent need help please!

    Hey guys! I've got an update! I've managed to do the first one, but i'm having an intense amount of difficulty finding code for the Fisher - Yates Shuffle Code, do you have any ideas of how i can implement it.

    BTW: I'M USING VISUAL BASIC 6 ACCESSED THROUGH MICROSOFT EXCEL

  12. #12
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Urgent need help please!

    Thread moved to the 'Office Development/VBA' forum... note that while it certainly isn't made clear, the "VB Editor" in Office programs is actually VBA rather than VB, so the 'VB6' forum is not really apt

  13. #13
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: Urgent need help please!

    The Fisher-Yates shuffle uses the following algorithm to sort a set of data into a random order in such a way that each different order is equally possible. You can use this, or another shuffle algorithm that you find on Google.
    It looks as if part of the assignment is to test your skills at searching for information, have you tried Googling for 'Fisher Yates' ? or "VB6 Fisher Yates"? You could also try looking for "Knuth". A good start for you might be to Search these Forums for "Knuth". If you do find some code I recommend that you put the appropriate attribution and web link into your answer. That way, whoever is marking your work will know that you looked around and will be able to see if and how you may have modified it to suit your particular needs.

  14. #14
    Lively Member Lidya212's Avatar
    Join Date
    Jul 2011
    Location
    Manado City
    Posts
    73

    Thumbs up Re: Urgent need help please!

    Quote Originally Posted by Mage0wnz216 View Post
    Problem 4
    Create an application that will allow a teacher to enter the scores for each student in their class and then display the scores in rank order (name and score for each student)
    The program should follow the following steps:
    1. Set the number of students in an array
    2. Ask the user for the Score for each student
    3. Sort the scores into rank order
    4. Display the Scores for each student in order
    Name you application Task5Sort
    Hint: Bubblesort (http://support.microsoft.com/default...b;en-us;133135)

    Problem 5
    Create an application that will read in a list of names and then display the names in a random order. The Fisher-Yates shuffle uses the following algorithm to sort a set of data into a random order in such a way that each different order is equally possible. You can use this, or another shuffle algorithm that you find on Google.
    The program should follow the following steps:
    1. Input a number of names into an array
    2. Have the values in the array arranged in a random order.
    3. Output the names onto a label.
    Fisher-Yates shuffle: http://en.wikipedia.org/wiki/Fisher%...3Yates_shuffle
    Name your application Task5Shuffle
    Hi, check this and this

    Hope it helps solving your homework

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width