|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
VB Arrays help
Here is a problem for an intro to VB course that I am having a ton of trouble with. I've done a good amount of searching and cannot seem to figure this out. If I could see the final code for this I could work my way backwards and grasp the concept. If any of you VB gurus out there could provide me the code to dissect I would be extremely grateful. the left alignment of this forum has messed up some of my equations, but I think it should still make sense. Just ask if clarification is needed.
Thanks in advance for any help provided! Statisticians use the concepts of mean and standard deviation to describe a collection of data. the mean is the average value of items, and the standard deviation measures the spread or dispersal of the numbers about the mean. formally, if x1, x2, x3,...,Xn, is a collection of data, then mean = m = x1+x2+x3+...+Xn ------------------ N standard deviation = S = /============================== / (x1-m)2 + (x2-m)2 + (x3-m)2+...+(Xnm)2 --------------------------------------- n-1 Write a program to: A) Place the exam scores 59,60,65,75,56,90,66,62,98,72,95,71,63,77,65,77,65 ,50,85 and 62 into an array; B ) Calculate the mean and standard deviation of the exam scores; C) Assign letter grades to each exam score, ES, as follows: ES greater than or equal to M + 1.5s is an A m+.5s less than or equal to ES < m+1.5s is a B m-.5s less than or equal ES < m+.5s is a C m-1.5s ES less than or equal m-.5s is a D ES < m-1.5s is an F For instance, if M were 70 and S were 12, then grades of 88 or above would receive A's, grades between 76 and 87 would receive B's, and so on. A process of this type is referred to as curving grades. D) Display a list of exam scores along with their corresponding grades |
|
#2
|
|||
|
|||
|
I won't give you source to your problem, because that would be cheating. ;|
However! All you would need to do is... 1.) Make an array, testMarks(1 to 20) as Integer, add you marks into this array. 2.) Have a for loop to iterate between testMarks, in this loop do #3. 3.) Add up your marks for the mean, dblMean as Double, dblMean = dblMean + testMarks(i) 4.) End your for loop, finish the mean calculation, dblMean = dblMean / UBound(testMarks) 5.) Use another for loop to iterate between testMarks again, this time to calculate standard deviation. 6.) Similar to the mean, you're going to add up the top part of the SD equation here, so dblSD as Double, dblSD = dblSD + (testMarks(i) - dblMean)^2 7.) End the loop, and finish your SD calculation, so something similar to dblSD = sqr((dblSD / (UBound(testMarks) - 1)) 8.) Now that you have SD and Mean, you can use another loop to loop through the marks, grade them, and display them where you want. Not sure if what I just wrote made any sense, but I hope it helped. |
|
#3
|
|||
|
|||
|
i also have this program due for this semester
why would you use the For Loop and not the Do While?
|
|
#4
|
|||
|
|||
|
Quote:
There's no difference? It would be easier to look at as well. |
|
#5
|
|||
|
|||
|
visual basic help...!
can you send me this program's codes?i can't do it
Statisticians use the concepts of mean and standard deviation to describe a collection of data. the mean is the average value of items, and the standard deviation measures the spread or dispersal of the numbers about the mean. formally, if x1, x2, x3,...,Xn, is a collection of data, then mean = m = x1+x2+x3+...+Xn ------------------ N standard deviation = S = /============================== / (x1-m)2 + (x2-m)2 + (x3-m)2+...+(Xnm)2 --------------------------------------- n-1 Write a program to: A) Place the exam scores 59,60,65,75,56,90,66,62,98,72,95,71,63,77,65,77,65 ,50,85 and 62 into an array; B ) Calculate the mean and standard deviation of the exam scores; C) Assign letter grades to each exam score, ES, as follows: ES greater than or equal to M + 1.5s is an A m+.5s less than or equal to ES < m+1.5s is a B m-.5s less than or equal ES < m+.5s is a C m-1.5s ES less than or equal m-.5s is a D ES < m-1.5s is an F For instance, if M were 70 and S were 12, then grades of 88 or above would receive A's, grades between 76 and 87 would receive B's, and so on. A process of this type is referred to as curving grades. D) Display a list of exam scores along with their corresponding grades |
|
#6
|
|||
|
|||
|
Quote:
Try asking in the Hire a Programmer forum, and be prepared to open your wallet.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#7
|
||||
|
||||
|
Quote:
Quote:
I'd be more than happy to write the program for you, but I still think it'd be cheating. And like Doug says, you'll have to pay. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > VB Arrays help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|