Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 3rd, 2006, 11:11 AM
Sarah_S Sarah_S is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Posts: 1 Sarah_S User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 19 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old December 11th, 2006, 03:02 PM
Alias-Zero Alias-Zero is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Location: localhost
Posts: 40 Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 14 h 44 m 12 sec
Reputation Power: 4
Send a message via ICQ to Alias-Zero Send a message via AIM to Alias-Zero Send a message via MSN to Alias-Zero Send a message via Yahoo to Alias-Zero
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.
Comments on this post
Zath agrees!

Reply With Quote
  #3  
Old December 18th, 2006, 05:26 PM
suy suy is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Posts: 1 suy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 6 sec
Reputation Power: 0
i also have this program due for this semester

why would you use the For Loop and not the Do While?

Reply With Quote
  #4  
Old December 18th, 2006, 08:00 PM
Alias-Zero Alias-Zero is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Location: localhost
Posts: 40 Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 14 h 44 m 12 sec
Reputation Power: 4
Send a message via ICQ to Alias-Zero Send a message via AIM to Alias-Zero Send a message via MSN to Alias-Zero Send a message via Yahoo to Alias-Zero
Quote:
Originally Posted by suy
why would you use the For Loop and not the Do While?


There's no difference? It would be easier to look at as well.

Reply With Quote
  #5  
Old January 3rd, 2007, 05:13 AM
yasindemir yasindemir is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 1 yasindemir User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 54 sec
Reputation Power: 0
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

Reply With Quote
  #6  
Old January 3rd, 2007, 05:09 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 57 m 26 sec
Reputation Power: 181
Quote:
Originally Posted by yasindemir
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

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

Reply With Quote
  #7  
Old January 3rd, 2007, 10:55 PM
Alias-Zero Alias-Zero is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Location: localhost
Posts: 40 Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 14 h 44 m 12 sec
Reputation Power: 4
Send a message via ICQ to Alias-Zero Send a message via AIM to Alias-Zero Send a message via MSN to Alias-Zero Send a message via Yahoo to Alias-Zero
Quote:
can you send me this program's codes?i can't do it


Quote:
Originally Posted by Doug G
Try asking in the Hire a Programmer forum, and be prepared to open your wallet.


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.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > VB Arrays help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT