Convert the mathematical expression to visual basic formula
W= Pr²÷√q²+s²
Module Module1
Sub Main()
Console.Write("Enter P: ")
Dim P As Double = Double.Parse(Console.ReadLine())
Console.Write("Enter r: ")
Dim r As Double = Double.Parse(Console.ReadLine())
Console.Write("Enter q: ")
Dim q As Double = Double.Parse(Console.ReadLine())
Console.Write("Enter s: ")
Dim s As Double = Double.Parse(Console.ReadLine())
Dim W As Double = P * r * r / Math.Sqrt(q * q + s * s)
Console.Write("W = {0}", W)
Console.ReadLine()
End Sub
End Module
Comments
Leave a comment