Solved

Converting this calculation to VB.Net

Posted on 2013-11-07
2
173 Views
Last Modified: 2013-11-07
Please see the attached screenshot. I need to make this calculation in a VB.Net app and I'm not sure what functions to use and how to format it. Any ideas? Also, how can it be validated?

Thanks!
Calculation.jpg
0
Comment
Question by:BlakeMcKenna
2 Comments
 
LVL 13

Accepted Solution

by:
Jesus Rodriguez earned 500 total points
ID: 39631008
If you got the list of the d number, the values for N1 and M1 then will be something like this

        Dim ListOf_d_Numbers As List(Of Double) = New List(Of Double)
        Dim SumOf_D_numbers As Double = 0
        Dim SM1 As New Double
        Dim N1 As New Double
        Dim M1 As New Double
        For Each NumberInList As Double In ListOf_d_Numbers
            SumOf_D_numbers += Math.Pow(NumberInList, 2)
        Next
        If (N1 - M1 - 1) = 0 Then
            MsgBox("Can Not be divide by 0")
        Else
            If (N1 - M1 - 1) < 0 Then
                MsgBox("Can not get Square root from a negative number.")
            Else
                SM1 = Math.Sqrt(SumOf_D_numbers / (N1 - M1 - 1))
            End If
        End If
0
 

Author Comment

by:BlakeMcKenna
ID: 39631707
Thanks k-designers!!! That worked!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now