9Mcode comment |
 |
 |
|
|
|
 |
- - - - - - - - - - - - - - ผู้ให้การสนับสนุน- - - - - - - - - - - - - -
|
|
 |
กระทู้ #1802 [Vb] (จาก IP: 117.47.55.83)
ขอ Source code โปรแกรมเครื่องคิดเลขหน่อยนะเจ้าค่ะ
ขอ Source code โปรแกรมเครื่องคิดเลขหน่อยนะเจ้าค่ะ คำนวณเหมือนเครื่องคิดเลข คือ + - * / นะค่ะ ขอบคุณล่วงหน้าเจ้าค่ะ
|
จากคุณ
:
น้องนัน / NP-nan@hotmail.com [2008-02-09 13:43:45]
|
|
ความคิดเห็น #26513 (จาก IP: 203.170.235.4)
โปรแกรม คิดเกรดเฉลี่ย Private Sub chkDone_Click(Index As Integer) Dim intCount As Integer, strChecked As String
If chkDone(Index).Value = vbChecked Then cmdDisplay.Enabled = True txtScore(Index).Enabled = True txtScore(Index).SetFocus Else txtScore(Index).Text = 0 txtScore(Index).Enabled = False strChecked = "N" Do While intCount <= 4 And strChecked = "N" If chkDone(intCount).Value = vbChecked Then strChecked = "y" End If intCount = intCount + 1 Loop If strChecked = "n" Then cmdDisplay.Enabled = False End If End If
End Sub
Private Sub cmdClear_Click() Dim x As Integer
For x = 0 To 4 chkDone(x).Value = False txtScore(x).Text = "" Next x
lblGrade.Caption = "" txtName.SetFocus
End Sub
Private Sub cmdDisplay_Click() Dim intEarned As Integer, intPossible As Integer Dim sngRatio As Single, intCount As Integer
For intCount = 0 To 4 If chkDone(intCount).Value = vbChecked Then intEarned = intEarned + Val(txtScore(intCount).Text) Select Case intCount Case 0 To 2 intPossible = intPossible + 10 Case Else intPossible = intPossible + 50 End Select End If Next intCount
sngRatio = intEarned / intPossible Select Case sngRatio Case Is >= 0.9 lblGrade.Caption = "A" Case Is >= 0.8 lblGrade.Caption = "B" Case Is >= 0.7 lblGrade.Caption = "C" Case Is >= 0.6 lblGrade.Caption = "D" Case Else lblGrade.Caption = "F" End Select
End Sub
Private Sub cmdExit_Click() Unload frmGrade
End Sub
Private Sub cmdPrint_Click() PrintForm End Sub
Private Sub Form_Load() frmGrade.Top = (Screen.Height - frmGrade.Height) / 2 frmGrade.Left = (Screen.Width - frmGrade.Width) / 2 End Sub
Private Sub Form_Unload(Cancel As Integer) Const conBtns As Integer = vbYesNo + vbExclamation + vbDefaultButton1 + vbApplicationModal Dim intUserResponse As Integer
intUserResponse = MsgBox("Do you want to exit?", conBtns, "Grade Application") If intUserResponse = vbNo Then 'User does not want to quit the app Cancel = 1 'prevent form unload. End If
End Sub
Private Sub txtScore_GotFocus(Index As Integer) txtScore(Index).SelStart = 0 txtScore(Index).SelLength = Len(txtScore(Index).Text)
End Sub |
จากคุณ
:
Nick / sanook__sanook@hotmail.com [2008-02-09 13:51:30]
|
 |
ความคิดเห็น #26833 (จาก IP: 61.19.213.155)
ขอ source code เครื่องคิดเลขหน่อยค่ะ ขอบคุณล่วงหน้านะค่ะ
จากคุณโอ่จ๊ะ |
จากคุณ
:
โอ๋ / supucha_2525@hotmail.com [2008-06-07 11:13:02]
|
 |
ความคิดเห็น #27002 (จาก IP: 58.8.233.71)
โค้ดทั้งหมด
Public Class FrmConvertDigit
Dim Status As String
Private Sub b1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b1.Click
If TxtDigit.Text = "0." Then TxtDigit.Text = "1" Else TxtDigit.Text &= "1" End If
End Sub
Private Sub b0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b0.Click
If TxtDigit.Text = "0." Then TxtDigit.Text = "0" Else TxtDigit.Text &= "0" End If
End Sub
Private Sub b2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b2.Click If TxtDigit.Text = "0." Then TxtDigit.Text = "2" Else TxtDigit.Text &= "2" End If End Sub
Private Sub b3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b3.Click If TxtDigit.Text = "0." Then TxtDigit.Text = "3" Else TxtDigit.Text &= "3" End If End Sub
Private Sub BClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BClear.Click
TxtDigit.Text = "0."
End Sub
Private Sub rBin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rBin.Click b0.Enabled = True b1.Enabled = True b2.Enabled = False b3.Enabled = False b4.Enabled = False b5.Enabled = False b6.Enabled = False b7.Enabled = False b8.Enabled = False b9.Enabled = False ba.Enabled = False bb.Enabled = False bc.Enabled = False bd.Enabled = False be.Enabled = False bf.Enabled = False
If Status = "BIN" Then
ElseIf Status = "OCT" Then '---convert 8 >>> 10 ----------- Dim sum As Int16 = 0 If TxtDigit.Text <> "0." Then
Dim k As Int16 = TxtDigit.TextLength For i As Int16 = 1 To TxtDigit.TextLength sum += (Mid(TxtDigit.Text, i, 1) * Math.Pow(8, k - i)) Next i
Else End If '---convert 10 >>> 2 ----------- Dim j As Int16 Dim result As String = "" Dim num1 As Int16 = sum Do j = num1 Mod 2 num1 = Int(num1 / 2) result &= j
Loop Until num1 = 0 TxtDigit.Text = StrReverse(result)
ElseIf Status = "DEC" Then
Dim j As Int16 Dim result As String = "" Dim num1 As Int16 = TxtDigit.Text Do j = num1 Mod 2 num1 = Int(num1 / 2) result &= j
Loop Until num1 = 0 TxtDigit.Text = StrReverse(result) End If
Status = "BIN"
End Sub
Private Sub rDec_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rDec.Click b0.Enabled = True b1.Enabled = True b2.Enabled = True b3.Enabled = True b4.Enabled = True b5.Enabled = True b6.Enabled = True b7.Enabled = True b8.Enabled = True b9.Enabled = True ba.Enabled = False bb.Enabled = False bc.Enabled = False bd.Enabled = False be.Enabled = False bf.Enabled = False
If Status = "DEC" Then ElseIf Status = "OCT" Then If TxtDigit.Text <> "0." Then Dim sum As Int16 = 0 Dim k As Int16 = TxtDigit.TextLength For i As Int16 = 1 To TxtDigit.TextLength sum += (Mid(TxtDigit.Text, i, 1) * Math.Pow(8, k - i)) Next i TxtDigit.Text = sum Else End If ElseIf Status = "BIN" Then If TxtDigit.Text <> "0." Then Dim sum As Int16 = 0 Dim k As Int16 = TxtDigit.TextLength For i As Int16 = 1 To TxtDigit.TextLength sum += (Mid(TxtDigit.Text, i, 1) * Math.Pow(2, k - i)) Next i TxtDigit.Text = sum Else End If
Else End If Status = "DEC"
End Sub
Private Sub FrmConvertDigit_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load rBin.Checked = True Status = "BIN"
End Sub
Private Sub b4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b4.Click If TxtDigit.Text = "0." Then TxtDigit.Text = "4" Else TxtDigit.Text &= "4" End If End Sub
Private Sub b5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b5.Click If TxtDigit.Text = "0." Then TxtDigit.Text = "5" Else TxtDigit.Text &= "5" End If End Sub
Private Sub b6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b6.Click If TxtDigit.Text = "0." Then TxtDigit.Text = "6" Else TxtDigit.Text &= "6" End If End Sub
Private Sub b7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b7.Click If TxtDigit.Text = "0." Then TxtDigit.Text = "7" Else TxtDigit.Text &= "7" End If End Sub
Private Sub rOct_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rOct.Click b0.Enabled = True b1.Enabled = True b2.Enabled = True b3.Enabled = True b4.Enabled = True b5.Enabled = True b6.Enabled = True b7.Enabled = True b8.Enabled = False b9.Enabled = False ba.Enabled = False bb.Enabled = False bc.Enabled = False bd.Enabled = False be.Enabled = False bf.Enabled = False
If Status = "OCT" Then
ElseIf Status = "BIN" Then '-- convert 2 >>> 10 ------- Dim sum As Int16 = 0 If TxtDigit.Text <> "0." Then Dim k As Int16 = TxtDigit.TextLength For i As Int16 = 1 To TxtDigit.TextLength sum += (Mid(TxtDigit.Text, i, 1) * Math.Pow(2, k - i)) Next i TxtDigit.Text = sum Else End If
'-- convert 10 >> 8 ------- Dim j As Int16 Dim result As String = "" Dim num1 As Int16 = sum Do j = num1 Mod 8 num1 = Int(num1 / 8) result &= j Loop Until num1 = 0 TxtDigit.Text = StrReverse(result)
ElseIf Status = "DEC" Then Dim j As Int16 Dim result As String = "" Dim num1 As Int16 = TxtDigit.Text Do j = num1 Mod 8 num1 = Int(num1 / 8) result &= j Loop Until num1 = 0 TxtDigit.Text = StrReverse(result) End If Status = "OCT"
End Sub
Private Sub b8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b8.Click If TxtDigit.Text = "0." Then TxtDigit.Text = "8" Else TxtDigit.Text &= "8" End If End Sub
Private Sub b9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b9.Click If TxtDigit.Text = "0." Then TxtDigit.Text = "9" Else TxtDigit.Text &= "9" End If End Sub
Private Sub AboutProgrammerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutProgrammerToolStripMenuItem.Click MsgBox("โปรแกรมแปลงเลขฐาน รุ่น 1.0 " & vbCrLf & "พัฒนาโดย อ. นัฐพงศ์ ส่งเนียม" & vbCrLf & "http://www.siam2dev.com") End Sub End Class
|
จากคุณ
:
Amary JooB / dazzling_fashions@hotmail.com [2008-08-18 19:37:43]
|
 |
ความคิดเห็น #28910 (จาก IP: 110.171.82.214)
ได้โจทย์มาให้เขียนโปรแกรมเครื่องคิดเลขประกอบด้วย เมธอดต่าง ดังนี้ addition +,Subtraction-,Multiplication*,Divistion/ โดยเมธอดทั้งสี่จะรับค่าเป็นจำนวนเต็มสองค่าและคืนค่าผลการคำนวนให้กับเมธอดที่เรียกใช้งาน
Lists of an arithmetic operator 1)Addition (+) 2)Subtraction (-) 3)Multiplication (*) 4)Divistion (/) Plaese select the arithmetic operator:1 Input a first number:5 Input a first nunber:18 the result is 23. |
จากคุณ
:
pp / krtkallaya@gmail.com [2013-09-21 14:27:54]
|
 |
ความคิดเห็น #28925 (จาก IP: 58.8.191.24)
มีเฉลยเป็น C++ ครับ ที่ http://www.sourcecode.in.th/homeworks.php?id=13 |
จากคุณ
:
maddog [2013-09-26 09:54:38]
|
 |
|
- - - - - - - - - - - - - - ผู้ให้การสนับสนุน- - - - - - - - - - - - - -
|
|
|
|
|
|
|