|
-
Aug 8th, 2011, 04:35 AM
#1
Thread Starter
New Member
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!
-
Aug 8th, 2011, 07:03 AM
#2
Hyperactive Member
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
-
Aug 8th, 2011, 10:14 AM
#3
Re: Urgent need help please!
 Originally Posted by Mage0wnz216
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.
-
Aug 8th, 2011, 06:33 PM
#4
Thread Starter
New Member
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?
-
Aug 9th, 2011, 12:45 AM
#5
Re: Urgent need help please!
 Originally Posted by Mage0wnz216
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
-
Aug 9th, 2011, 02:35 AM
#6
Thread Starter
New Member
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:
-
Aug 9th, 2011, 10:47 AM
#7
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.
-
Aug 9th, 2011, 10:51 AM
#8
Re: Urgent need help please!
 Originally Posted by MartinLiss
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,...
-
Aug 9th, 2011, 10:53 AM
#9
Re: Urgent need help please!
 Originally Posted by akhileshbc
If you are talking about the Bubblesort code, then it's VBA ! Isn't it ?

Why?
-
Aug 9th, 2011, 10:57 AM
#10
Re: Urgent need help please!
 Originally Posted by akhileshbc
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
-
Aug 10th, 2011, 06:08 AM
#11
Thread Starter
New Member
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
-
Aug 10th, 2011, 07:55 AM
#12
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
-
Aug 10th, 2011, 11:14 PM
#13
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.
-
Aug 11th, 2011, 12:33 AM
#14
Lively Member
Re: Urgent need help please!
 Originally Posted by Mage0wnz216
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|