Question calculator

SolomonOtoo

New member
Joined
Dec 21, 2014
Messages
1
Programming Experience
Beginner
how to i code cosine, tangent and sine in vb.net. i am trying to develop a calculator with this function and am stack in the middle.
 
Here is a Console application that should answer some of your questions:


Dim ang, radian As Double, deg As String
Dim Degrees As Double = Math.PI / 180
Console.WriteLine("Trigonometric functions use radians rather than degrees.")
Console.Write("Enter an angle in degrees: ")
deg = Console.ReadLine()
Double.TryParse(deg, ang)
If ang > 360 Then ang = 360
radian = ang * Degrees
Console.WriteLine(vbCrLf & "The sine of your angle is {0}", Math.Sin(radian))
Console.WriteLine("The cosine of your angle is {0}", Math.Cos(radian))
Console.WriteLine("The tangent of your angle is {0}", Math.Tan(radian))
Console.ReadLine()
 
Back
Top