Project Requirements and Analysis Unit 2
You are working as the software tester for a large school and need to test the exam calculator for students. Your school does not want students to use a physical calculator. The software development team has released a calculator application. You need to ensure that everything is working as expected.
Address the following:
- Download the calculator executable file and source code file.
- Write the functional test cases for the Calculator application. Here is the sample test case document.
- You need to create the Excel file with the following columns:
- Test Case ID
- Test Case Name
- Test Case Scenario
- Detailed Test Steps
- Test Data
- Expected Results
- Actual Results After Test Case Execution
- Create at least 20 test cases in a single Excel file.
- Execute each of the test cases, and update the actual results in the After Test Case Execution column.
- Provide an explanation as to whether the school should release this calculator to students.
ITSD324-Calc/ITSD324-Calc.sln
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project(“{F184B08F-C81C-45F6-A57F-5ABD9991F28F}”) = “ITSD324-Calc”, “ITSD324-Calc\ITSD324-Calc.vbproj”, “{314654CB-F7DF-4B53-817D-2D007FD9EEE1}”
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{314654CB-F7DF-4B53-817D-2D007FD9EEE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{314654CB-F7DF-4B53-817D-2D007FD9EEE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{314654CB-F7DF-4B53-817D-2D007FD9EEE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{314654CB-F7DF-4B53-817D-2D007FD9EEE1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
ITSD324-Calc/ITSD324-Calc.suo
ITSD324-Calc/ITSD324-Calc/bin/Debug/ITSD324-Calc.exe
ITSD324-Calc/ITSD324-Calc/bin/Debug/ITSD324-Calc.pdb
ITSD324-Calc/ITSD324-Calc/bin/Debug/ITSD324-Calc.vshost.exe
ITSD324-Calc/ITSD324-Calc/bin/Debug/ITSD324-Calc.xml
ITSD324-Calc
ITSD324-Calc/ITSD324-Calc/Form1.Designer.vb
Partial Class Form1
Inherits System.Windows.Forms.Form
‘Form overrides dispose to clean up the component list.
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
‘Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
‘NOTE: The following procedure is required by the Windows Form Designer
‘It can be modified using the Windows Form Designer.
‘Do not modify it using the code editor.
Private Sub InitializeComponent()
Me.btnExit = New System.Windows.Forms.Button
Me.btnAdd = New System.Windows.Forms.Button
Me.btnSubtract = New System.Windows.Forms.Button
Me.btnMultiply = New System.Windows.Forms.Button
Me.btnDivide = New System.Windows.Forms.Button
Me.btnAbsolute = New System.Windows.Forms.Button
Me.btnCOS = New System.Windows.Forms.Button
Me.btnSIN = New System.Windows.Forms.Button
Me.btnTAN = New System.Windows.Forms.Button
Me.btnInput0 = New System.Windows.Forms.Button
Me.btnPosNeg = New System.Windows.Forms.Button
Me.btnDecimal = New System.Windows.Forms.Button
Me.btnEqual = New System.Windows.Forms.Button
Me.btnInput1 = New System.Windows.Forms.Button
Me.btnInput2 = New System.Windows.Forms.Button
Me.btnInput3 = New System.Windows.Forms.Button
Me.btnInput4 = New System.Windows.Forms.Button
Me.btnInput5 = New System.Windows.Forms.Button
Me.btnInput6 = New System.Windows.Forms.Button
Me.btnSquare = New System.Windows.Forms.Button
Me.btnInput7 = New System.Windows.Forms.Button
Me.btnInput8 = New System.Windows.Forms.Button
Me.btnInput9 = New System.Windows.Forms.Button
Me.btnSQRT = New System.Windows.Forms.Button
Me.btnClear = New System.Windows.Forms.Button
Me.txtDisplay = New System.Windows.Forms.TextBox
Me.SuspendLayout()
‘
‘btnExit
‘
Me.btnExit.AllowDrop = True
Me.btnExit.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnExit.ForeColor = System.Drawing.Color.Red
Me.btnExit.Location = New System.Drawing.Point(12, 80)
Me.btnExit.Name = “btnExit”
Me.btnExit.Size = New System.Drawing.Size(61, 41)
Me.btnExit.TabIndex = 56
Me.btnExit.Text = “Exit”
Me.btnExit.UseVisualStyleBackColor = True
‘
‘btnAdd
‘
Me.btnAdd.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnAdd.ForeColor = System.Drawing.Color.Blue
Me.btnAdd.Location = New System.Drawing.Point(322, 293)
Me.btnAdd.Name = “btnAdd”
Me.btnAdd.Size = New System.Drawing.Size(61, 46)
Me.btnAdd.TabIndex = 55
Me.btnAdd.Text = “+”
Me.btnAdd.UseVisualStyleBackColor = True
‘
‘btnSubtract
‘
Me.btnSubtract.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnSubtract.ForeColor = System.Drawing.Color.Blue
Me.btnSubtract.Location = New System.Drawing.Point(322, 241)
Me.btnSubtract.Name = “btnSubtract”
Me.btnSubtract.Size = New System.Drawing.Size(61, 46)
Me.btnSubtract.TabIndex = 54
Me.btnSubtract.Text = “-”
Me.btnSubtract.UseVisualStyleBackColor = True
‘
‘btnMultiply
‘
Me.btnMultiply.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnMultiply.ForeColor = System.Drawing.Color.Blue
Me.btnMultiply.Location = New System.Drawing.Point(322, 188)
Me.btnMultiply.Name = “btnMultiply”
Me.btnMultiply.Size = New System.Drawing.Size(61, 46)
Me.btnMultiply.TabIndex = 53
Me.btnMultiply.Text = “*”
Me.btnMultiply.UseVisualStyleBackColor = True
‘
‘btnDivide
‘
Me.btnDivide.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnDivide.ForeColor = System.Drawing.Color.Blue
Me.btnDivide.Location = New System.Drawing.Point(322, 137)
Me.btnDivide.Name = “btnDivide”
Me.btnDivide.Size = New System.Drawing.Size(61, 46)
Me.btnDivide.TabIndex = 52
Me.btnDivide.Text = “/”
Me.btnDivide.UseVisualStyleBackColor = True
‘
‘btnAbsolute
‘
Me.btnAbsolute.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnAbsolute.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer))
Me.btnAbsolute.Location = New System.Drawing.Point(12, 293)
Me.btnAbsolute.Name = “btnAbsolute”
Me.btnAbsolute.Size = New System.Drawing.Size(61, 46)
Me.btnAbsolute.TabIndex = 51
Me.btnAbsolute.Text = “Abs”
Me.btnAbsolute.UseVisualStyleBackColor = True
‘
‘btnCOS
‘
Me.btnCOS.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnCOS.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer))
Me.btnCOS.Location = New System.Drawing.Point(12, 241)
Me.btnCOS.Name = “btnCOS”
Me.btnCOS.Size = New System.Drawing.Size(61, 46)
Me.btnCOS.TabIndex = 50
Me.btnCOS.Text = “COS”
Me.btnCOS.UseVisualStyleBackColor = True
‘
‘btnSIN
‘
Me.btnSIN.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnSIN.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer))
Me.btnSIN.Location = New System.Drawing.Point(12, 189)
Me.btnSIN.Name = “btnSIN”
Me.btnSIN.Size = New System.Drawing.Size(61, 46)
Me.btnSIN.TabIndex = 49
Me.btnSIN.Text = “Sin”
Me.btnSIN.UseVisualStyleBackColor = True
‘
‘btnTAN
‘
Me.btnTAN.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnTAN.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer))
Me.btnTAN.Location = New System.Drawing.Point(12, 137)
Me.btnTAN.Name = “btnTAN”
Me.btnTAN.Size = New System.Drawing.Size(61, 46)
Me.btnTAN.TabIndex = 48
Me.btnTAN.Text = “Tan”
Me.btnTAN.UseVisualStyleBackColor = True
‘
‘btnInput0
‘
Me.btnInput0.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnInput0.Location = New System.Drawing.Point(88, 293)
Me.btnInput0.Name = “btnInput0”
Me.btnInput0.Size = New System.Drawing.Size(61, 46)
Me.btnInput0.TabIndex = 47
Me.btnInput0.Text = “0”
Me.btnInput0.UseVisualStyleBackColor = True
‘
‘btnPosNeg
‘
Me.btnPosNeg.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnPosNeg.Location = New System.Drawing.Point(164, 293)
Me.btnPosNeg.Name = “btnPosNeg”
Me.btnPosNeg.Size = New System.Drawing.Size(61, 46)
Me.btnPosNeg.TabIndex = 46
Me.btnPosNeg.Text = “+ -”
Me.btnPosNeg.UseVisualStyleBackColor = True
‘
‘btnDecimal
‘
Me.btnDecimal.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnDecimal.Location = New System.Drawing.Point(243, 293)
Me.btnDecimal.Name = “btnDecimal”
Me.btnDecimal.Size = New System.Drawing.Size(61, 46)
Me.btnDecimal.TabIndex = 45
Me.btnDecimal.Text = “.”
Me.btnDecimal.UseVisualStyleBackColor = True
‘
‘btnEqual
‘
Me.btnEqual.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.btnEqual.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnEqual.ForeColor = System.Drawing.Color.Blue
Me.btnEqual.Location = New System.Drawing.Point(400, 241)
Me.btnEqual.Name = “btnEqual”
Me.btnEqual.Size = New System.Drawing.Size(61, 98)
Me.btnEqual.TabIndex = 44
Me.btnEqual.Text = “=”
Me.btnEqual.UseVisualStyleBackColor = True
‘
‘btnInput1
‘
Me.btnInput1.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnInput1.Location = New System.Drawing.Point(88, 241)
Me.btnInput1.Name = “btnInput1”
Me.btnInput1.Size = New System.Drawing.Size(61, 46)
Me.btnInput1.TabIndex = 43
Me.btnInput1.Text = “1”
Me.btnInput1.UseVisualStyleBackColor = True
‘
‘btnInput2
‘
Me.btnInput2.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnInput2.Location = New System.Drawing.Point(164, 241)
Me.btnInput2.Name = “btnInput2”
Me.btnInput2.Size = New System.Drawing.Size(61, 46)
Me.btnInput2.TabIndex = 42
Me.btnInput2.Text = “2”
Me.btnInput2.UseVisualStyleBackColor = True
‘
‘btnInput3
‘
Me.btnInput3.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnInput3.Location = New System.Drawing.Point(243, 241)
Me.btnInput3.Name = “btnInput3”
Me.btnInput3.Size = New System.Drawing.Size(61, 46)
Me.btnInput3.TabIndex = 41
Me.btnInput3.Text = “3”
Me.btnInput3.UseVisualStyleBackColor = True
‘
‘btnInput4
‘
Me.btnInput4.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnInput4.Location = New System.Drawing.Point(88, 189)
Me.btnInput4.Name = “btnInput4”
Me.btnInput4.Size = New System.Drawing.Size(61, 46)
Me.btnInput4.TabIndex = 40
Me.btnInput4.Text = “4”
Me.btnInput4.UseVisualStyleBackColor = True
‘
‘btnInput5
‘
Me.btnInput5.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnInput5.Location = New System.Drawing.Point(164, 188)
Me.btnInput5.Name = “btnInput5”
Me.btnInput5.Size = New System.Drawing.Size(61, 46)
Me.btnInput5.TabIndex = 39
Me.btnInput5.Text = “5”
Me.btnInput5.UseVisualStyleBackColor = True
‘
‘btnInput6
‘
Me.btnInput6.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnInput6.Location = New System.Drawing.Point(243, 189)
Me.btnInput6.Name = “btnInput6”
Me.btnInput6.Size = New System.Drawing.Size(61, 46)
Me.btnInput6.TabIndex = 38
Me.btnInput6.Text = “6”
Me.btnInput6.UseVisualStyleBackColor = True
‘
‘btnSquare
‘
Me.btnSquare.Font = New System.Drawing.Font(“Tahoma”, 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnSquare.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer))
Me.btnSquare.Location = New System.Drawing.Point(400, 189)
Me.btnSquare.Name = “btnSquare”
Me.btnSquare.Size = New System.Drawing.Size(61, 46)
Me.btnSquare.TabIndex = 37
Me.btnSquare.Text = “Square”
Me.btnSquare.UseVisualStyleBackColor = True
‘
‘btnInput7
‘
Me.btnInput7.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnInput7.Location = New System.Drawing.Point(88, 137)
Me.btnInput7.Name = “btnInput7”
Me.btnInput7.Size = New System.Drawing.Size(61, 46)
Me.btnInput7.TabIndex = 36
Me.btnInput7.Text = “7”
Me.btnInput7.UseVisualStyleBackColor = True
‘
‘btnInput8
‘
Me.btnInput8.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnInput8.Location = New System.Drawing.Point(164, 137)
Me.btnInput8.Name = “btnInput8”
Me.btnInput8.Size = New System.Drawing.Size(61, 46)
Me.btnInput8.TabIndex = 35
Me.btnInput8.Text = “8”
Me.btnInput8.UseVisualStyleBackColor = True
‘
‘btnInput9
‘
Me.btnInput9.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnInput9.ForeColor = System.Drawing.Color.Black
Me.btnInput9.Location = New System.Drawing.Point(243, 137)
Me.btnInput9.Name = “btnInput9”
Me.btnInput9.Size = New System.Drawing.Size(61, 46)
Me.btnInput9.TabIndex = 34
Me.btnInput9.Text = “9”
Me.btnInput9.UseVisualStyleBackColor = True
‘
‘btnSQRT
‘
Me.btnSQRT.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnSQRT.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer))
Me.btnSQRT.Location = New System.Drawing.Point(400, 137)
Me.btnSQRT.Name = “btnSQRT”
Me.btnSQRT.Size = New System.Drawing.Size(61, 46)
Me.btnSQRT.TabIndex = 33
Me.btnSQRT.Text = “SQRT”
Me.btnSQRT.UseVisualStyleBackColor = True
‘
‘btnClear
‘
Me.btnClear.AllowDrop = True
Me.btnClear.Font = New System.Drawing.Font(“Tahoma”, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnClear.ForeColor = System.Drawing.Color.Red
Me.btnClear.Location = New System.Drawing.Point(322, 80)
Me.btnClear.Name = “btnClear”
Me.btnClear.Size = New System.Drawing.Size(139, 41)
Me.btnClear.TabIndex = 32
Me.btnClear.Text = “Clear”
Me.btnClear.UseVisualStyleBackColor = True
‘
‘txtDisplay
‘
Me.txtDisplay.BackColor = System.Drawing.SystemColors.ControlLightLight
Me.txtDisplay.Font = New System.Drawing.Font(“Tahoma”, 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtDisplay.Location = New System.Drawing.Point(12, 35)
Me.txtDisplay.Name = “txtDisplay”
Me.txtDisplay.Size = New System.Drawing.Size(449, 30)
Me.txtDisplay.TabIndex = 31
Me.txtDisplay.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
‘
‘Form1
‘
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(494, 366)
Me.Controls.Add(Me.btnExit)
Me.Controls.Add(Me.btnAdd)
Me.Controls.Add(Me.btnSubtract)
Me.Controls.Add(Me.btnMultiply)
Me.Controls.Add(Me.btnDivide)
Me.Controls.Add(Me.btnAbsolute)
Me.Controls.Add(Me.btnCOS)
Me.Controls.Add(Me.btnSIN)
Me.Controls.Add(Me.btnTAN)
Me.Controls.Add(Me.btnInput0)
Me.Controls.Add(Me.btnPosNeg)
Me.Controls.Add(Me.btnDecimal)
Me.Controls.Add(Me.btnEqual)
Me.Controls.Add(Me.btnInput1)
Me.Controls.Add(Me.btnInput2)
Me.Controls.Add(Me.btnInput3)
Me.Controls.Add(Me.btnInput4)
Me.Controls.Add(Me.btnInput5)
Me.Controls.Add(Me.btnInput6)
Me.Controls.Add(Me.btnSquare)
Me.Controls.Add(Me.btnInput7)
Me.Controls.Add(Me.btnInput8)
Me.Controls.Add(Me.btnInput9)
Me.Controls.Add(Me.btnSQRT)
Me.Controls.Add(Me.btnClear)
Me.Controls.Add(Me.txtDisplay)
Me.Name = “Form1”
Me.Text = “ITSD324 Calc”
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents btnExit As System.Windows.Forms.Button
Friend WithEvents btnAdd As System.Windows.Forms.Button
Friend WithEvents btnSubtract As System.Windows.Forms.Button
Friend WithEvents btnMultiply As System.Windows.Forms.Button
Friend WithEvents btnDivide As System.Windows.Forms.Button
Friend WithEvents btnAbsolute As System.Windows.Forms.Button
Friend WithEvents btnCOS As System.Windows.Forms.Button
Friend WithEvents btnSIN As System.Windows.Forms.Button
Friend WithEvents btnTAN As System.Windows.Forms.Button
Friend WithEvents btnInput0 As System.Windows.Forms.Button
Friend WithEvents btnPosNeg As System.Windows.Forms.Button
Friend WithEvents btnDecimal As System.Windows.Forms.Button
Friend WithEvents btnEqual As System.Windows.Forms.Button
Friend WithEvents btnInput1 As System.Windows.Forms.Button
Friend WithEvents btnInput2 As System.Windows.Forms.Button
Friend WithEvents btnInput3 As System.Windows.Forms.Button
Friend WithEvents btnInput4 As System.Windows.Forms.Button
Friend WithEvents btnInput5 As System.Windows.Forms.Button
Friend WithEvents btnInput6 As System.Windows.Forms.Button
Friend WithEvents btnSquare As System.Windows.Forms.Button
Friend WithEvents btnInput7 As System.Windows.Forms.Button
Friend WithEvents btnInput8 As System.Windows.Forms.Button
Friend WithEvents btnInput9 As System.Windows.Forms.Button
Friend WithEvents btnSQRT As System.Windows.Forms.Button
Friend WithEvents btnClear As System.Windows.Forms.Button
Friend WithEvents txtDisplay As System.Windows.Forms.TextBox
End Class
ITSD324-Calc/ITSD324-Calc/Form1.resx
text/microsoft-resx
2.0
System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
ITSD324-Calc/ITSD324-Calc/Form1.vb
Option Explicit On
Option Strict On
Imports System.Math
Public Class Form1
Dim gdblFirstNumber As Double ‘ global variable to hold the first set of numbers in basic math: + – / *
Dim gstrMathToPerform As String ‘ global variable to hold the math formula to be used
Dim gboolAppendDisplay As Boolean ‘ global variables used to determine whether a number pressed will append to
‘ to the display text box or replace the contents of the display text box.
Private Sub subUpdateDisplay(ByVal strInput As String)
‘ Sometimes we want to APPEND and sometimes we want to REPLACE
‘ Somtimes = IF/THEN/ELSE
‘ we read the variable gboolAppendDisplay in here to determine whether we
‘ append or replace.
Try
‘If the display is a 0, then the number clicked will REPLACE the 0 and not append to it.
‘ for example, if the display is equal to 1 and the user clicks 9, then 9 will append to the 1: 19
‘ if the display is equal to 0 and the user clicks the 9, then 9 will replace the 0: 9 (and not 09)
If Me.txtDisplay.Text = “0” Then
gboolAppendDisplay = False ‘REPLACE
End If
If gboolAppendDisplay = True Then
‘ Appends:
Me.txtDisplay.Text = Me.txtDisplay.Text & strInput
Else
‘ Replaces:
Me.txtDisplay.Text = strInput
End If
gboolAppendDisplay = True ‘append to the display
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub subDoTheMath()
‘ so the user clicked the = sign. that’s why we’re executing the statements in this sub
‘ we need three pieces of information to do the math:
‘ First set of numbers >> variable dblOperator
‘ Operator >> variable strOperator
‘ Second Set of numbers >> this is in the text box
Try
‘ Step 1 – Declare the variables
‘ we need one for the answer and one for the 2nd set of numbers
Dim dblSecondSetOfNumbers As Double
Dim dblAnswer As Double
‘ Step 2 – Copy the numbers currently in the textbox to a numeric variable
dblSecondSetOfNumbers = System.Convert.ToDouble(Me.txtDisplay.Text)
‘ Step 3 – Do the math
Select Case gstrMathToPerform
Case “Addition”
dblAnswer = gdblFirstNumber + dblSecondSetOfNumbers
Case “Multiplication”
dblAnswer = gdblFirstNumber * dblSecondSetOfNumbers
‘Case “Subtraction”
‘dblAnswer = gdblFirstNumber – dblSecondSetOfNumbers
Case “SQRT”
dblAnswer = System.Math.Sqrt(dblSecondSetOfNumbers)
Case “TAN”
dblAnswer = System.Math.Tan(dblSecondSetOfNumbers)
Case “POSNEG”
dblAnswer = dblSecondSetOfNumbers * -1
End Select
‘ Step 4 – Copy results to the text box that holds the answer.
‘ for this calculator the answer text box happens to be the same as the input text box
Me.txtDisplay.Text = dblAnswer.ToString()
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Call subClearDisplay() ‘ resets the text box to 0
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub subClearDisplay()
Try
Me.txtDisplay.Text = “0” ‘ resets the text box to 0
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub btnInput0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInput0.Click
Try
Call subUpdateDisplay(“0”)
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub btnInput1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInput1.Click
Try
Call subUpdateDisplay(“1”)
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub btnInput2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInput2.Click
Try
Call subUpdateDisplay(“2”)
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub btnInput3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInput3.Click
Try
Call subUpdateDisplay(“3”)
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub btnInput4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInput4.Click
Try
Call subUpdateDisplay(“4”)
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub btnInput8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInput8.Click
Try
Call subUpdateDisplay(“8”)
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub btnInput9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInput9.Click
Try
Call subUpdateDisplay(“9”)
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
Try
Call subClearDisplay() ‘reset the display.
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub btnMultiply_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMultiply.Click
Try
‘ we need to store the fact that the user clicked the multiply button.
‘ We will use this information when the user clicks the = sign.
gstrMathToPerform = “Multiplication”
‘ we know the user is done entering the first set of numbers. So store this value
‘ We will use this information when the user clicks the = sign.
gdblFirstNumber = System.Convert.ToDouble(Me.txtDisplay.Text)
‘ The next number typed in should replace the display and not append.
gboolAppendDisplay = False
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub btnSQRT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSQRT.Click
Try
‘ Set the variable which will determine which math formula to use.
gstrMathToPerform = “SQRT”
‘ call the sub routine that actually does the math.
Call subDoTheMath()
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub btnEquals_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEqual.Click
Try
‘ call the sub routine that actually does the math.
Call subDoTheMath()
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub btnDecimal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDecimal.Click
Try
‘ Since a calculator can only display one decimal, we must first determine if the display
‘ already contains a decimal.
If Me.txtDisplay.Text.Contains(“.”) = True Then
‘if the display already contains a decimal, then beep
Beep()
Else
‘if the display doesn’t contain a decimal, then add it using the subUpdateDisplay sub
Call subUpdateDisplay(“.”)
End If
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Try
End ‘end the program.
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub btnTAN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTAN.Click
Try
‘ Set the variable which will determine which math formula to use.
gstrMathToPerform = “TAN”
‘ call the sub routine that actually does the math.
Call subDoTheMath()
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Try
‘ we need to store the fact that the user clicked the multiply button.
‘ We will use this information when the user clicks the = sign.
gstrMathToPerform = “Addition”
‘ we know the user is done entering the first set of numbers. So store this value
‘ We will use this information when the user clicks the = sign.
gdblFirstNumber = System.Convert.ToDouble(Me.txtDisplay.Text)
‘ The next number typed in should replace the display and not append.
gboolAppendDisplay = False
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub btnPosNeg_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPosNeg.Click
Try
‘ Set the variable which will determine which math formula to use.
gstrMathToPerform = “POSNEG”
‘ call the sub routine that actually does the math.
Call subDoTheMath()
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
Private Sub btnSubtract_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubtract.Click
Try
‘ we need to store the fact that the user clicked the multiply button.
‘ We will use this information when the user clicks the = sign.
gstrMathToPerform = “Subtract”
‘ we know the user is done entering the first set of numbers. So store this value
‘ We will use this information when the user clicks the = sign.
gdblFirstNumber = System.Convert.ToDouble(Me.txtDisplay.Text)
‘ The next number typed in should replace the display and not append.
gboolAppendDisplay = True
Catch ex As Exception
MsgBox(“There is an error”)
End Try
End Sub
End Class
ITSD324-Calc/ITSD324-Calc/ITSD324-Calc.vbproj
Debug
AnyCPU
9.0.30729
2.0
{314654CB-F7DF-4B53-817D-2D007FD9EEE1}
WinExe
ITSD324_Calc.My.MyApplication
ITSD324_Calc
ITSD324-Calc
512
WindowsForms
v3.5
On
Binary
Off
On
true
full
true
true
bin\Debug\
ITSD324-Calc.xml
42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
pdbonly
false
true
true
bin\Release\
ITSD324-Calc.xml
42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
3.5
3.5
3.5
Form
Form1.vb
Form
True
Application.myapp
True
True
Resources.resx
True
Settings.settings
True
Form1.vb
VbMyResourcesResXFileCodeGenerator
Resources.Designer.vb
My.Resources
Designer
MyApplicationCodeGenerator
Application.Designer.vb
SettingsSingleFileGenerator
My
Settings.Designer.vb
ITSD324-Calc/ITSD324-Calc/ITSD324-Calc.vbproj.user
ITSD324-Calc/ITSD324-Calc/My Project/Application.Designer.vb
‘——————————————————————————
‘
‘ This code was generated by a tool.
‘ Runtime Version:2.0.50727.4952
‘
‘ Changes to this file may cause incorrect behavior and will be lost if
‘ the code is regenerated.
‘
‘——————————————————————————
Option Strict On
Option Explicit On
Namespace My
‘NOTE: This file is auto-generated; do not modify it directly. To make changes,
‘ or if you encounter build errors in this file, go to the Project Designer
‘ (go to Project Properties or double-click the My Project node in
‘ Solution Explorer), and make changes on the Application tab.
‘
Partial Friend Class MyApplication
Public Sub New()
MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
Me.IsSingleInstance = false
Me.EnableVisualStyles = true
Me.SaveMySettingsOnExit = true
Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
End Sub
Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.ITSD324_Calc.Form1
End Sub
End Class
End Namespace
ITSD324-Calc/ITSD324-Calc/My Project/Application.myapp
true
Form1
false
0
true
0
0
true
ITSD324-Calc/ITSD324-Calc/My Project/AssemblyInfo.vb
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
‘ General Information about an assembly is controlled through the following
‘ set of attributes. Change these attribute values to modify the information
‘ associated with an assembly.
‘ Review the values of the assembly attributes
‘The following GUID is for the ID of the typelib if this project is exposed to COM
‘ Version information for an assembly consists of the following four values:
‘
‘ Major Version
‘ Minor Version
‘ Build Number
‘ Revision
‘
‘ You can specify all the values or you can default the Build and Revision Numbers
‘ by using the ‘*’ as shown below:
‘
ITSD324-Calc/ITSD324-Calc/My Project/Resources.Designer.vb
‘——————————————————————————
‘
‘ This code was generated by a tool.
‘ Runtime Version:2.0.50727.4952
‘
‘ Changes to this file may cause incorrect behavior and will be lost if
‘ the code is regenerated.
‘
‘——————————————————————————
Option Strict On
Option Explicit On
Namespace My.Resources
‘This class was auto-generated by the StronglyTypedResourceBuilder
‘class via a tool like ResGen or Visual Studio.
‘To add or remove a member, edit your .ResX file then rerun ResGen
‘with the /str option, or rebuild your VS project.
‘
‘
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
‘
‘
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager(“ITSD324_Calc.Resources”, GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
‘
‘ resource lookups using this strongly typed resource class.
‘
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set(ByVal value As Global.System.Globalization.CultureInfo)
resourceCulture = value
End Set
End Property
End Module
End Namespace
ITSD324-Calc/ITSD324-Calc/My Project/Resources.resx
text/microsoft-resx
2.0
System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
ITSD324-Calc/ITSD324-Calc/My Project/Settings.Designer.vb
‘——————————————————————————
‘
‘ This code was generated by a tool.
‘ Runtime Version:2.0.50727.4952
‘
‘ Changes to this file may cause incorrect behavior and will be lost if
‘ the code is regenerated.
‘
‘——————————————————————————
Option Strict On
Option Explicit On
Namespace My
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
#Region “My.Settings Auto-Save Functionality”
#If _MyType = “WindowsForms” Then
Private Shared addedHandler As Boolean
Private Shared addedHandlerLockObject As New Object
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
End Sub
#End If
#End Region
Public Shared ReadOnly Property [Default]() As MySettings
Get
#If _MyType = “WindowsForms” Then
If Not addedHandler Then
SyncLock addedHandlerLockObject
If Not addedHandler Then
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
addedHandler = True
End If
End SyncLock
End If
#End If
Return defaultInstance
End Get
End Property
End Class
End Namespace
Namespace My
Friend Module MySettingsProperty
Friend ReadOnly Property Settings() As Global.ITSD324_Calc.My.MySettings
Get
Return Global.ITSD324_Calc.My.MySettings.Default
End Get
End Property
End Module
End Namespace
ITSD324-Calc/ITSD324-Calc/My Project/Settings.settings
ITSD324-Calc/ITSD324-Calc/obj/Debug/ITSD324_Calc.Form1.resources
ITSD324-Calc/ITSD324-Calc/obj/Debug/ITSD324_Calc.Resources.resources
ITSD324-Calc/ITSD324-Calc/obj/Debug/ITSD324-Calc.exe
ITSD324-Calc/ITSD324-Calc/obj/Debug/ITSD324-Calc.pdb
ITSD324-Calc/ITSD324-Calc/obj/Debug/ITSD324-Calc.vbproj.FileListAbsolute.txt
C:\Users\Tony.LoCoco\AppData\Local\Temporary Projects\ITSD324-Calc\bin\Debug\ITSD324-Calc.exe
C:\Users\Tony.LoCoco\AppData\Local\Temporary Projects\ITSD324-Calc\bin\Debug\ITSD324-Calc.pdb
C:\Users\Tony.LoCoco\AppData\Local\Temporary Projects\ITSD324-Calc\bin\Debug\ITSD324-Calc.xml
C:\Users\Tony.LoCoco\AppData\Local\Temporary Projects\ITSD324-Calc\obj\Debug\ResolveAssemblyReference.cache
C:\Users\Tony.LoCoco\AppData\Local\Temporary Projects\ITSD324-Calc\obj\Debug\ITSD324_Calc.Form1.resources
C:\Users\Tony.LoCoco\AppData\Local\Temporary Projects\ITSD324-Calc\obj\Debug\ITSD324_Calc.Resources.resources
C:\Users\Tony.LoCoco\AppData\Local\Temporary Projects\ITSD324-Calc\obj\Debug\ITSD324-Calc.vbproj.GenerateResource.Cache
C:\Users\Tony.LoCoco\AppData\Local\Temporary Projects\ITSD324-Calc\obj\Debug\ITSD324-Calc.exe
C:\Users\Tony.LoCoco\AppData\Local\Temporary Projects\ITSD324-Calc\obj\Debug\ITSD324-Calc.xml
C:\Users\Tony.LoCoco\AppData\Local\Temporary Projects\ITSD324-Calc\obj\Debug\ITSD324-Calc.pdb
C:\Users\Tony.LoCoco\Desktop\ITSD324-Calc\ITSD324-Calc\obj\Debug\ITSD324-Calc.exe
C:\Users\Tony.LoCoco\Desktop\ITSD324-Calc\ITSD324-Calc\obj\Debug\ITSD324-Calc.xml
C:\Users\Tony.LoCoco\Desktop\ITSD324-Calc\ITSD324-Calc\obj\Debug\ITSD324-Calc.pdb
C:\Users\Tony.LoCoco\Desktop\ITSD324-Calc\ITSD324-Calc\bin\Debug\ITSD324-Calc.exe
C:\Users\Tony.LoCoco\Desktop\ITSD324-Calc\ITSD324-Calc\bin\Debug\ITSD324-Calc.pdb
C:\Users\Tony.LoCoco\Desktop\ITSD324-Calc\ITSD324-Calc\bin\Debug\ITSD324-Calc.xml
C:\Users\Tony.LoCoco\Desktop\ITSD324-Calc\ITSD324-Calc\obj\Debug\ResolveAssemblyReference.cache
C:\Users\Tony.LoCoco\Desktop\ITSD324-Calc\ITSD324-Calc\obj\Debug\ITSD324_Calc.Form1.resources
C:\Users\Tony.LoCoco\Desktop\ITSD324-Calc\ITSD324-Calc\obj\Debug\ITSD324_Calc.Resources.resources
C:\Users\Tony.LoCoco\Desktop\ITSD324-Calc\ITSD324-Calc\obj\Debug\ITSD324-Calc.vbproj.GenerateResource.Cache
ITSD324-Calc/ITSD324-Calc/obj/Debug/ITSD324-Calc.vbproj.GenerateResource.Cache
ITSD324-Calc/ITSD324-Calc/obj/Debug/ITSD324-Calc.xml
ITSD324-Calc
ITSD324-Calc/ITSD324-Calc/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll
ITSD324-Calc – Executable.exe