Solved

Converting this calculation to VB.Net

Posted on 2013-11-07
2
171 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
Comment Utility
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
Comment Utility
Thanks k-designers!!! That worked!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

10 Experts available now in Live!

Get 1:1 Help Now