Click here to Skip to main content
15,901,122 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHyperlink is added when mail send from outlook Pin
dcdhingra28-Oct-09 1:19
dcdhingra28-Oct-09 1:19 
QuestionUsing command prompt to get information needed Pin
offroaderdan28-Oct-09 0:47
offroaderdan28-Oct-09 0:47 
AnswerRe: Using command prompt to get information needed [modified] Pin
Dave Kreskowiak28-Oct-09 3:37
mveDave Kreskowiak28-Oct-09 3:37 
QuestionArray Standard Deviation HELP Pin
PAguilar0927-Oct-09 21:44
PAguilar0927-Oct-09 21:44 
AnswerRe: Array Standard Deviation HELP Pin
Christian Graus27-Oct-09 22:11
protectorChristian Graus27-Oct-09 22:11 
GeneralRe: Array Standard Deviation HELP Pin
PAguilar0927-Oct-09 22:32
PAguilar0927-Oct-09 22:32 
GeneralRe: Array Standard Deviation HELP Pin
Christian Graus27-Oct-09 23:39
protectorChristian Graus27-Oct-09 23:39 
GeneralRe: Array Standard Deviation HELP Pin
PAguilar0928-Oct-09 1:43
PAguilar0928-Oct-09 1:43 
So when you say that my code will only work once, then Do i need to declare in the subroutine my variables = 0??

I am converting the strArray(count) to Double because it is declared as a STRING when i create the variable. I dont know if it is the correct way to be doing it

on the last code you explained about, what it is doing is dividing the sum that has been passed to the Variable(iSum, a INTEGER)
then divide that by the total number of grades the user has entered, i convert it to double because since its a label.text it is a STRING not a numeric value.

Here is my total code maybe someone can tell me what it is i am dng wrong?? I have everything working fine BUT THE dDev = ((strArr(count)- dFAvg) ^2)
and then take that value being stored into dDev for each item from the listbox and find teh sum again.


Public Class GradeForm

Dim str As String
Dim strArr() As String
Dim count As Integer
Dim iSum As Integer = 0
Dim dFAvg As Double = 0
Dim dDev As Double = 0
Dim dSqDev As Double = 0
Dim dTotalDev As Double
Dim STD As Double


Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
'*************************************************************************************
'in this subroutine the User will click the save button to save grades to an array and
'then display the data required by the program.
'*************************************************************************************


Str = txtGrades.Text 'store string into variable
strArr = str.Split(" ") 'use split to seperate words by space



For count = 0 To strArr.Length - 1
'add user entered values to list box
lstGrades.Items.Add(strArr(count))
lblGrades.Text = lstGrades.Items.Count
iSum += Convert.ToDouble(strArr(count)) 'get sum of values entered and pass to storing variable
lblSum.Text = iSum 'display sum in label box
'***********************
dFAvg = iSum / Convert.ToDouble(lblGrades.Text) 'calculate average
'***********************

'********************THIS IS WHAT IS NOT WORKING CORRECTLY IT SEEMS THAT IT ISN'T GETTING EACH ELEMENT OR ITEM FROM TEH LIST BOX AND HAVE IT SUBRTRACTED BY THE AVG/MEAN, THEN RAISE IT OR MULTIPLY IT BY ITSELF (^2)***************************D
dDev = ((strArr(count) - dFAvg) ^ 2)
dSqDev += dDev

Next 'end for


lblAvg.Text = FormatNumber(dFAvg, 2) 'display average after storing calculation in variable, format to display only 2 decimal places

'this IS STILL NOT WORKING!!!!!*************************
lblSumDev.Text = FormatNumber(dDev, 2)


''''''''''''''''''''''this part is correct

STD = (lblSumDev.Text / (strArr.Length - 1))
Dim final As Double = Math.Round(Math.Sqrt(STD), 2)

lblStdDev.Text = final


End Sub
QuestionHow to make multiline textbox to display the last element added or scroll to last? Pin
pallaka27-Oct-09 20:50
pallaka27-Oct-09 20:50 
AnswerRe: How to make multiline textbox to display the last element added or scroll to last? Pin
Christian Graus27-Oct-09 21:30
protectorChristian Graus27-Oct-09 21:30 
GeneralRe: How to make multiline textbox to display the last element added or scroll to last? Pin
freakyit27-Oct-09 21:53
freakyit27-Oct-09 21:53 
GeneralRe: How to make multiline textbox to display the last element added or scroll to last? Pin
pallaka28-Oct-09 0:03
pallaka28-Oct-09 0:03 
QuestionUsing Avicap32 for Video Recording Pin
kjsl2k927-Oct-09 20:46
kjsl2k927-Oct-09 20:46 
AnswerRe: Using Avicap32 for Video Recording Pin
Christian Graus27-Oct-09 21:29
protectorChristian Graus27-Oct-09 21:29 
QuestionWeb Application using Visual Studio 2005 & .NET ! Pin
jeshra27927-Oct-09 20:46
jeshra27927-Oct-09 20:46 
AnswerRe: Web Application using Visual Studio 2005 & .NET ! Pin
_Damian S_27-Oct-09 20:55
professional_Damian S_27-Oct-09 20:55 
GeneralRe: Web Application using Visual Studio 2005 & .NET ! Pin
jeshra27927-Oct-09 21:33
jeshra27927-Oct-09 21:33 
GeneralRe: Web Application using Visual Studio 2005 & .NET ! Pin
Christian Graus27-Oct-09 22:10
protectorChristian Graus27-Oct-09 22:10 
QuestionArray Help Pin
PAguilar0927-Oct-09 20:25
PAguilar0927-Oct-09 20:25 
AnswerRe: Array Help Pin
tosch27-Oct-09 20:38
tosch27-Oct-09 20:38 
GeneralRe: Array Help Pin
PAguilar0927-Oct-09 20:44
PAguilar0927-Oct-09 20:44 
AnswerRe: Array Help Pin
_Damian S_27-Oct-09 20:59
professional_Damian S_27-Oct-09 20:59 
GeneralRe: Array Help Pin
PAguilar0927-Oct-09 21:08
PAguilar0927-Oct-09 21:08 
QuestionError while read Text File Pin
Anubhava Dimri27-Oct-09 20:04
Anubhava Dimri27-Oct-09 20:04 
AnswerRe: Error while read Text File Pin
Christian Graus27-Oct-09 21:31
protectorChristian Graus27-Oct-09 21:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.