Computer Science, asked by shreyans12345678910, 1 year ago

program to create a functional calculator in visual basic

Answers

Answered by Dastageer08
7
For the Sin button, enter the following code:

Private Sub CmdSin_Click()

sinx = Round(Sin(displayValue * 4 * Atn(1) / 180), 4)
panel.Caption = sinx

End Sub

* The Round function is to correct the output to certain number of decimal places.

For the Cos button, enter the following code:

Private Sub CmdCos_Click()

cosx = Round(Cos(displayValue * 4 * Atn(1) / 180), 4)
panel.Caption = cosx

End Sub

For the Tan button, enter the following code:

Private Sub CmdTan_Click()

tanx = Round(Tan(displayValue * 4 * Atn(1) / 180), 4)
panel.Caption = tanx

End Sub

For the Ln button, enter the following code:

Private Sub CmdLn_Click()
panel.Caption = Log(displayValue)
End Sub

and for the Log button, enter the following code:

Private Sub CmdLog_Click()
panel.Caption = Log(displayValue) / Log(10)
End Sub

Attachments:
Similar questions