Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 190
  • Last Modified:

Converting this calculation to VB.Net

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
BlakeMcKenna
Asked:
BlakeMcKenna
1 Solution
 
Jesus RodriguezIT ManagerCommented:
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
 
BlakeMcKennaAuthor Commented:
Thanks k-designers!!! That worked!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now