VERSION 5.00 Begin VB.Form Form1 BorderStyle = 1 'Fixed Single Caption = "Calculator" ClientHeight = 3765 ClientLeft = 45 ClientTop = 435 ClientWidth = 5595 LinkTopic = "Form1" MaxButton = 0 'False ScaleHeight = 3765 ScaleWidth = 5595 StartUpPosition = 2 'CenterScreen Begin VB.CommandButton Command28 Caption = "yRx" Height = 375 Left = 4800 TabIndex = 35 ToolTipText = "returns the y root of x" Top = 1440 Width = 495 End Begin VB.CheckBox Check1 Caption = "Tps" Height = 375 Left = 2400 TabIndex = 34 Top = 1800 Width = 615 End Begin VB.CommandButton Command27 Caption = "(x+y+z)^2" Height = 375 Left = 5880 TabIndex = 33 Top = 3120 Width = 975 End Begin VB.CommandButton Command26 Caption = "(x-y)^3" Height = 375 Left = 5880 TabIndex = 32 Top = 2760 Width = 975 End Begin VB.CommandButton Command25 Caption = "(x+y)^3" Height = 375 Left = 5880 TabIndex = 31 Top = 2400 Width = 975 End Begin VB.CommandButton Command24 Caption = "(x^3-y^3)" Height = 375 Left = 5880 TabIndex = 30 Top = 2040 Width = 975 End Begin VB.CommandButton Command23 Caption = "(x^3+y^3)" Height = 375 Left = 5880 TabIndex = 29 Top = 1680 Width = 975 End Begin VB.CommandButton Command22 Caption = "(x^2-y^2)" Height = 375 Left = 5880 TabIndex = 28 Top = 1320 Width = 975 End Begin VB.CommandButton Command21 Caption = "(x^2+y^2)" Height = 375 Left = 5880 TabIndex = 27 Top = 960 Width = 975 End Begin VB.CommandButton Command20 Caption = "(x-y)^2" Height = 375 Left = 5880 TabIndex = 26 Top = 600 Width = 975 End Begin VB.CommandButton Command19 Caption = "(x+y)^2" Height = 375 Left = 5880 TabIndex = 25 Top = 240 Width = 975 End Begin VB.CommandButton Command18 Caption = "Mod" Height = 375 Left = 4800 TabIndex = 24 Top = 840 Width = 495 End Begin VB.CommandButton Command17 Caption = "1/x" Height = 375 Left = 3600 TabIndex = 23 Top = 840 Width = 495 End Begin VB.CommandButton Command16 Caption = "\" Height = 375 Left = 4320 TabIndex = 22 Top = 840 Width = 495 End Begin VB.CommandButton Command15 Caption = "ð" Height = 375 Left = 4920 TabIndex = 21 Top = 2040 Width = 375 End Begin VB.CommandButton Command14 Caption = "SqR" Height = 375 Left = 4320 TabIndex = 20 ToolTipText = "returns the square root of x" Top = 1440 Width = 495 End Begin VB.CommandButton Command13 Caption = "C" Height = 495 Left = 4800 TabIndex = 19 Top = 3000 Width = 495 End Begin VB.CommandButton Command12 Caption = "C(a)" Height = 375 Left = 2400 TabIndex = 18 Top = 2400 Width = 615 End Begin VB.CommandButton Command11 Caption = "y=z" Height = 255 Left = 3840 TabIndex = 16 Top = 3240 Width = 735 End Begin VB.CommandButton Command10 Caption = "x=z" Height = 255 Left = 3840 TabIndex = 15 Top = 3000 Width = 735 End Begin VB.CommandButton Command9 Caption = "| X |" Height = 375 Left = 3600 TabIndex = 14 Top = 1440 Width = 495 End Begin VB.CommandButton Command8 Caption = "x^3" Height = 375 Left = 4800 TabIndex = 11 Top = 240 Width = 495 End Begin VB.CommandButton Command7 Caption = "x^2" Height = 375 Left = 4320 TabIndex = 10 Top = 240 Width = 495 End Begin VB.CommandButton Command6 Caption = "x^y" Height = 375 Left = 3600 TabIndex = 9 Top = 240 Width = 495 End Begin VB.CommandButton Command5 Caption = "-" Height = 375 Left = 360 TabIndex = 8 Top = 2400 Width = 375 End Begin VB.CommandButton Command4 Caption = "*" Height = 375 Left = 960 TabIndex = 7 Top = 1800 Width = 375 End Begin VB.CommandButton Command3 Caption = "/" Height = 375 Left = 960 TabIndex = 6 Top = 2400 Width = 375 End Begin VB.CommandButton Command1 Caption = "+" Height = 375 Left = 360 TabIndex = 5 Top = 1800 Width = 375 End Begin VB.CommandButton Command2 Caption = "=" Height = 975 Left = 1560 TabIndex = 4 Top = 1800 Width = 495 End Begin VB.TextBox Text2 Height = 375 Left = 360 TabIndex = 1 Top = 1080 Width = 2775 End Begin VB.TextBox Text1 Height = 375 Left = 360 TabIndex = 0 Top = 240 Width = 2775 End Begin VB.Label Label5 BackStyle = 0 'Transparent Caption = "Z=" Height = 255 Left = 120 TabIndex = 17 Top = 3120 Width = 255 End Begin VB.Label Label4 Caption = "Y=" Height = 255 Left = 120 TabIndex = 13 Top = 1080 Width = 255 End Begin VB.Label Label3 Caption = "X=" Height = 255 Left = 120 TabIndex = 12 Top = 240 Width = 255 End Begin VB.Label Label2 Alignment = 2 'Center Height = 255 Left = 1320 TabIndex = 3 Top = 720 Width = 735 End Begin VB.Label Label1 Alignment = 2 'Center BorderStyle = 1 'Fixed Single BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 161 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 315 Left = 360 TabIndex = 2 Top = 3120 Width = 3255 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub Check1_Click() If Check1.Value = 1 Then Form1.Width = 7200 Else Form1.Width = 5640 End If End Sub Private Sub Command1_Click() Label2.Caption = "+" End Sub Private Sub Command10_Click() Text1.Text = Label1.Caption End Sub Private Sub Command11_Click() Text2.Text = Label1.Caption End Sub Private Sub Command12_Click() Text1.Text = "" Text2.Text = "" Label1.Caption = "" Label2.Caption = "" End Sub Private Sub Command13_Click() Label1.Caption = "" End Sub Private Sub Command14_Click() Dim x x = Val(Text1.Text) Label1.Caption = Sqr(x) End Sub Private Sub Command15_Click() Text1.Text = "3" & "." & "14156265358979" End Sub Private Sub Command16_Click() Label2.Caption = "\" End Sub Private Sub Command17_Click() Dim x x = Val(Text1.Text) If x = 0 Then Label1.Caption = "Error" Else Label1.Caption = 1 / x End If End Sub Private Sub Command18_Click() Label2.Caption = "Mod" End Sub Private Sub Command19_Click() Dim x, y x = Val(Text1.Text) y = Val(Text2.Text) Label1.Caption = (x + y) ^ 2 End Sub Private Sub Command2_Click() Dim x, y x = Val(Text1.Text) y = Val(Text2.Text) If Label2.Caption = "+" Then Label1.Caption = x + y End If If Label2.Caption = "-" Then Label1.Caption = x - y End If If Label2.Caption = "*" Then Label1.Caption = x * y End If If Label2.Caption = "\" Then If Val(Text2.Text) = 0 Then Label1.Caption = "Error" Else Label1.Caption = x \ y End If End If If Label2.Caption = "Mod" Then If Val(Text2.Text) = 0 Then Label1.Caption = "Error" Else Label1.Caption = x Mod y End If End If If Label2.Caption = "/" Then If Val(Text2.Text) = 0 Then Label1.Caption = "Error" Else Label1.Caption = x / y End If End If End Sub Private Sub Command20_Click() Dim x, y x = Val(Text1.Text) y = Val(Text2.Text) Label1.Caption = (x - y) ^ 2 End Sub Private Sub Command21_Click() Dim x, y x = Val(Text1.Text) y = Val(Text2.Text) Label1.Caption = (x ^ 2 + y ^ 2) End Sub Private Sub Command22_Click() Dim x, y x = Val(Text1.Text) y = Val(Text2.Text) Label1.Caption = (x ^ 2 - y ^ 2) End Sub Private Sub Command23_Click() Dim x, y x = Val(Text1.Text) y = Val(Text2.Text) Label1.Caption = (x ^ 3 + y ^ 3) End Sub Private Sub Command24_Click() Dim x, y x = Val(Text1.Text) y = Val(Text2.Text) Label1.Caption = (x ^ 3 - y ^ 3) End Sub Private Sub Command25_Click() Dim x, y x = Val(Text1.Text) y = Val(Text2.Text) Label1.Caption = (x + y) ^ 3 End Sub Private Sub Command26_Click() Dim x, y x = Val(Text1.Text) y = Val(Text2.Text) Label1.Caption = (x - y) ^ 3 End Sub Private Sub Command27_Click() Dim x, y x = Val(Text1.Text) y = Val(Text2.Text) z = Val(Label1.Caption) Label1.Caption = (x + y + z) ^ 2 End Sub Private Sub Command28_Click() Dim x, y x = Val(Text1.Text) y = Val(Text2.Text) If y <= 0 Then Text2.Text = "" Else Label1.Caption = x ^ (1 / y) End If End Sub Private Sub Command3_Click() Label2.Caption = "/" End Sub Private Sub Command4_Click() Label2.Caption = "*" End Sub Private Sub Command5_Click() Label2.Caption = "-" End Sub Private Sub Command6_Click() Dim x, y x = Val(Text1.Text) y = Val(Text2.Text) On Error GoTo Label1 Label1.Caption = x ^ y Exit Sub Label1: MsgBox "Too long function", 64, "Error" End Sub Private Sub Command7_Click() Dim x x = Val(Text1.Text) Label1.Caption = x ^ 2 End Sub Private Sub Command8_Click() Dim x x = Val(Text1.Text) Label1.Caption = x ^ 3 End Sub Private Sub Command9_Click() Dim x x = Val(Text1.Text) Label1.Caption = Abs(x) End Sub