목차
● 문제개요
● 알고리즘
● 실행화면
● 문제점
● 결과 및 느낀점
● frmCalc
● 알고리즘
● 실행화면
● 문제점
● 결과 및 느낀점
● frmCalc
본문내용
n = intFstNum
blForlabel = True
historyCounter = 0
blCheckDot = False
Else
intOperator = 2
intFstNum = intTrdNum
blCheck = True
lblWindow.Caption = \"\"
historyCounter = 0
blCheckDot = False
End If
Else
lblWindow.Caption = \"\"
End If
End Sub
Private Sub cmdMultiply_Click()
\' * 버튼
If blStart Then
If blCheck Then
intFstNum = intFstNum * intSndNum
lblWindow.Caption = intFstNum
blForlabel = True
historyCounter = 0
blCheckDot = False
Else
intOperator = 3
intFstNum = intTrdNum
blCheck = True
lblWindow.Caption = \"\"
historyCounter = 0
blCheckDot = False
End If
Else
lblWindow.Caption = \"\"
End If
End Sub
Private Sub cmdDivision_Click()
\' / 버튼
If blStart Then
If blCheck Then
If intSndNum = 0 Then \' 분모에는 0이 들어갈수 없다.
lblWindow.Caption = \"0으로 나눌수 없습니다.\"
blForlabel = True
historyCounter = 0
blCheckDot = False
Else
intFstNum = intFstNum / intSndNum
lblWindow.Caption = intFstNum
blForlabel = True
historyCounter = 0
blCheckDot = False
End If
Else
intOperator = 4
intFstNum = intTrdNum
blCheck = True
lblWindow.Caption = \"\"
historyCounter = 0
blCheckDot = False
End If
Else
lblWindow.Caption = \"\"
End If
End Sub
Private Sub cmdOk_Click()
\' = 버튼
Select Case intOperator
Case 0 \' 연산버튼이 한번도 안눌렸다면 계산을 안한다.
lblWindow.Caption = lblWindow.Caption
historyCounter = 0
Case 1
intFstNum = intFstNum + intSndNum
intTrdNum = intFstNum \' 추가로 계속 연산을 수행하고 싶을때를 위함.
lblWindow.Caption = intFstNum
historyCounter = 0
blCheck = False \' 계속 연산을 할수 있게해준다.
blForlabel = True
blCheckDot = False
Case 2
intFstNum = intFstNum - intSndNum
intTrdNum = intFstNum
lblWindow.Caption = intFstNum
historyCounter = 0
blCheck = False
blForlabel = True
blCheckDot = False
Case 3
intFstNum = intFstNum * intSndNum
intTrdNum = intFstNum
lblWindow.Caption = intFstNum
historyCounter = 0
blCheck = False
blForlabel = True
blCheckDot = False
Case 4
If intSndNum = 0 Then \' 분모에는 0을 받지 않는다.
lblWindow.Caption = \"0으로 나눌수 없습니다.\"
historyCounter = 0
blForlabel = True
blCheckDot = False
Else
intFstNum = intFstNum / intSndNum
intTrdNum = intFstNum
lblWindow.Caption = intFstNum
historyCounter = 0
blCheck = False
blForlabel = True
blCheckDot = False
End If
End Select
End Sub
Private Sub cmdClear_Click()
\'intFstNum만 남기고 전부다 초기화
blCheck = False
intOperator = 0
historyCounter = 0
intSndNum = 0
intTrdNum = 0
lblWindow.Caption = \"\"
blCheckDot = False
End Sub
Private Sub cmdClearAll_Click()
\'계산기를 초기상태로 초기화 한다.
intFstNum = 0
intSndNum = 0
intTrdNum = 0
intOperator = 0
historyCounter = 0
blCheck = False
blForlabel = False
blStart = False
lblWindow.Caption = \"\"
blCheckDot = False
End Sub
Private Sub cmdBack_Click()
\' 한칸지우기 버튼
If historyCounter = 0 Then
lblWindow.Caption = lblWindow.Caption
intSndNum = 0
intTrdNum = 0
Else
historyCounter = historyCounter - 1
lblWindow.Caption = intHistory(historyCounter)
If lblWindow.Caption = \"\" Then
intSndNum = 0
intTrdNum = 0
Else
intSndNum = lblWindow.Caption
intTrdNum = lblWindow.Caption
End If
End If
If historyCounter < historyDot Then
blCheckDot = False
End If
End Sub
Private Sub cmdEnd_Click()
End
End Sub
blForlabel = True
historyCounter = 0
blCheckDot = False
Else
intOperator = 2
intFstNum = intTrdNum
blCheck = True
lblWindow.Caption = \"\"
historyCounter = 0
blCheckDot = False
End If
Else
lblWindow.Caption = \"\"
End If
End Sub
Private Sub cmdMultiply_Click()
\' * 버튼
If blStart Then
If blCheck Then
intFstNum = intFstNum * intSndNum
lblWindow.Caption = intFstNum
blForlabel = True
historyCounter = 0
blCheckDot = False
Else
intOperator = 3
intFstNum = intTrdNum
blCheck = True
lblWindow.Caption = \"\"
historyCounter = 0
blCheckDot = False
End If
Else
lblWindow.Caption = \"\"
End If
End Sub
Private Sub cmdDivision_Click()
\' / 버튼
If blStart Then
If blCheck Then
If intSndNum = 0 Then \' 분모에는 0이 들어갈수 없다.
lblWindow.Caption = \"0으로 나눌수 없습니다.\"
blForlabel = True
historyCounter = 0
blCheckDot = False
Else
intFstNum = intFstNum / intSndNum
lblWindow.Caption = intFstNum
blForlabel = True
historyCounter = 0
blCheckDot = False
End If
Else
intOperator = 4
intFstNum = intTrdNum
blCheck = True
lblWindow.Caption = \"\"
historyCounter = 0
blCheckDot = False
End If
Else
lblWindow.Caption = \"\"
End If
End Sub
Private Sub cmdOk_Click()
\' = 버튼
Select Case intOperator
Case 0 \' 연산버튼이 한번도 안눌렸다면 계산을 안한다.
lblWindow.Caption = lblWindow.Caption
historyCounter = 0
Case 1
intFstNum = intFstNum + intSndNum
intTrdNum = intFstNum \' 추가로 계속 연산을 수행하고 싶을때를 위함.
lblWindow.Caption = intFstNum
historyCounter = 0
blCheck = False \' 계속 연산을 할수 있게해준다.
blForlabel = True
blCheckDot = False
Case 2
intFstNum = intFstNum - intSndNum
intTrdNum = intFstNum
lblWindow.Caption = intFstNum
historyCounter = 0
blCheck = False
blForlabel = True
blCheckDot = False
Case 3
intFstNum = intFstNum * intSndNum
intTrdNum = intFstNum
lblWindow.Caption = intFstNum
historyCounter = 0
blCheck = False
blForlabel = True
blCheckDot = False
Case 4
If intSndNum = 0 Then \' 분모에는 0을 받지 않는다.
lblWindow.Caption = \"0으로 나눌수 없습니다.\"
historyCounter = 0
blForlabel = True
blCheckDot = False
Else
intFstNum = intFstNum / intSndNum
intTrdNum = intFstNum
lblWindow.Caption = intFstNum
historyCounter = 0
blCheck = False
blForlabel = True
blCheckDot = False
End If
End Select
End Sub
Private Sub cmdClear_Click()
\'intFstNum만 남기고 전부다 초기화
blCheck = False
intOperator = 0
historyCounter = 0
intSndNum = 0
intTrdNum = 0
lblWindow.Caption = \"\"
blCheckDot = False
End Sub
Private Sub cmdClearAll_Click()
\'계산기를 초기상태로 초기화 한다.
intFstNum = 0
intSndNum = 0
intTrdNum = 0
intOperator = 0
historyCounter = 0
blCheck = False
blForlabel = False
blStart = False
lblWindow.Caption = \"\"
blCheckDot = False
End Sub
Private Sub cmdBack_Click()
\' 한칸지우기 버튼
If historyCounter = 0 Then
lblWindow.Caption = lblWindow.Caption
intSndNum = 0
intTrdNum = 0
Else
historyCounter = historyCounter - 1
lblWindow.Caption = intHistory(historyCounter)
If lblWindow.Caption = \"\" Then
intSndNum = 0
intTrdNum = 0
Else
intSndNum = lblWindow.Caption
intTrdNum = lblWindow.Caption
End If
End If
If historyCounter < historyDot Then
blCheckDot = False
End If
End Sub
Private Sub cmdEnd_Click()
End
End Sub
소개글