سلام من نه رشتم کامپیوتره نه نیازی به یاد گیری برنامه نویسی دارم به عنوان یک تکلیف اجباری مدرسه باید برنامه ماشین حسابی بنویسم که معمولی باشه نه مهندسی و ناقص نباشه 1 هفته مهلت دارم کمک کنید{ویژوال بیسیک 6}
سلام من نه رشتم کامپیوتره نه نیازی به یاد گیری برنامه نویسی دارم به عنوان یک تکلیف اجباری مدرسه باید برنامه ماشین حسابی بنویسم که معمولی باشه نه مهندسی و ناقص نباشه 1 هفته مهلت دارم کمک کنید{ویژوال بیسیک 6}
Last edited by Senator_Offline; 03-04-2009 at 10:16.
Dim bank, s
Dim sum, men, ta, zarb, dat, M As Boolean
Private Sub c_Click()
s = Text1.Text
End Sub
Private Sub Command11_Click()
If dat = False Then
Text1.Text = Text1.Text + "."
dat = True
End If
End Sub
Private Sub Command1_Click()
If M = True Then
Text1.Text = ""
M = False
End If
If Text1.Text = "0" Then
Text1.Text = "1"
Exit Sub
End If
Text1.Text = Text1.Text + "1"
End Sub
Private Sub Command2_Click()
If M = True Then
Text1.Text = ""
M = False
End If
If Text1.Text = "0" Then
Text1.Text = "2"
Exit Sub
End If
Text1.Text = Text1.Text + "2"
End Sub
Private Sub Command3_Click()
If M = True Then
Text1.Text = ""
M = False
End If
If Text1.Text = "0" Then
Text1.Text = "3"
Exit Sub
End If
Text1.Text = Text1.Text + "3"
End Sub
Private Sub Command4_Click()
If M = True Then
Text1.Text = ""
M = False
End If
If Text1.Text = "0" Then
Text1.Text = "4"
Exit Sub
End If
Text1.Text = Text1.Text + "4"
End Sub
Private Sub Command5_Click()
If M = True Then
Text1.Text = ""
M = False
End If
If Text1.Text = "0" Then
Text1.Text = "5"
Exit Sub
End If
Text1.Text = Text1.Text + "5"
End Sub
Private Sub Command6_Click()
If M = True Then
Text1.Text = ""
M = False
End If
If Text1.Text = "0" Then
Text1.Text = "6"
Exit Sub
End If
Text1.Text = Text1.Text + "6"
End Sub
Private Sub Command7_Click()
If M = True Then
Text1.Text = ""
M = False
End If
If Text1.Text = "0" Then
Text1.Text = "7"
Exit Sub
End If
Text1.Text = Text1.Text + "7"
End Sub
Private Sub Command8_Click()
If M = True Then
Text1.Text = ""
M = False
End If
If Text1.Text = "0" Then
Text1.Text = "8"
Exit Sub
End If
Text1.Text = Text1.Text + "8"
End Sub
Private Sub Command9_Click()
If M = True Then
Text1.Text = ""
M = False
End If
If Text1.Text = "0" Then
Text1.Text = "9"
Exit Sub
End If
Text1.Text = Text1.Text + "9"
End Sub
Private Sub Command10_Click()
If M = True Then
Text1.Text = ""
M = False
End If
If Text1.Text = "0" Then
Text1.Text = "0"
Exit Sub
End If
Text1.Text = Text1.Text + "0"
End Sub
Private Sub Command17_Click()
Text1.Text = ""
bank = 0
sum = False
men = False
ta = False
zarb = False
dat = False
M = False
End Sub
Private Sub Command16_Click()
If sum = True Then
bank = bank + Val(Text1.Text)
Text1.Text = ""
Exit Sub
End If
sum = True
men = False
ta = False
zarb = False
dat = False
If Val(Text1.Text) = 0 Then
Exit Sub
End If
bank = Val(Text1.Text)
Text1.Text = ""
End Sub
Private Sub Command15_Click()
If men = True Then
bank = bank - Val(Text1.Text)
Text1.Text = ""
Exit Sub
End If
men = True
sum = False
ta = False
zarb = False
dat = False
If Val(Text1.Text) = 0 Then
Exit Sub
End If
bank = Val(Text1.Text)
Text1.Text = ""
End Sub
Private Sub Command14_Click()
If ta = True Then
bank = bank / Val(Text1.Text)
Text1.Text = ""
Exit Sub
End If
ta = True
sum = False
men = False
zarb = False
dat = False
If Val(Text1.Text) = 0 Then
Exit Sub
End If
bank = Val(Text1.Text)
Text1.Text = ""
End Sub
Private Sub Command13_Click()
If zarb = True Then
bank = bank * Val(Text1.Text)
Text1.Text = ""
Exit Sub
End If
zarb = True
sum = False
men = False
ta = False
dat = False
If Val(Text1.Text) = 0 Then
Exit Sub
End If
bank = Val(Text1.Text)
Text1.Text = ""
End Sub
Private Sub Command12_Click()
If sum = True Then
Text1.Text = bank + Val(Text1.Text)
sum = False
End If
If men = True Then
Text1.Text = bank - Val(Text1.Text)
men = False
End If
If ta = True Then
If Val(Text1.Text) = 0 Then
ta = False
Text1.Text = "Cannot divide by zero"
Exit Sub
End If
Text1.Text = bank / Val(Text1.Text)
ta = False
End If
If zarb = True Then
Text1.Text = bank * Val(Text1.Text)
zarb = False
End If
zarb = False
sum = False
men = False
ta = False
dat = True
M = True
bank = 0
این برنامه رو از اینترنت گرفتم اگه نفهمیدی بگو که یکی هم خودم نوشتم البته زیاد روش کار نکردم. کاملش کنم و برات بذارم
با سلام
من اين برنامه رو خودم نوشتم، لينك دانلودش رو براتون ميذارم:
اگر مشكلي داشت حتما بگو!!!!!!
[ برای مشاهده لینک ، با نام کاربری خود وارد شوید یا ثبت نام کنید ]
اينم لينك :
کد:برای مشاهده محتوا ، لطفا وارد شوید یا ثبت نام کنید
من این ماشن حساب رو با vb.net نوشتم می تونی بعضی از کداشو به vb تغییر بدی ولی این حسن داره که مو لا درزش نمی ره
PublicClass form1
Dim a, b, c AsByte
Dim x AsSingle
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If (TextBox1.Text = "0") Or (a = 1) Then
x = CSng(TextBox1.Text)
TextBox1.Clear()
EndIf
If a = 3 Then
TextBox1.Clear()
a = 0
EndIf
TextBox1.Text = TextBox1.Text & "1"
a = 0
EndSub
PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If (TextBox1.Text = "0") Or (a = 1) Then
x = CSng(TextBox1.Text)
TextBox1.Clear()
a = 0
EndIf
If a = 3 Then
TextBox1.Clear()
a = 0
EndIf
TextBox1.Text = TextBox1.Text & "2"
EndSub
PrivateSub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If (TextBox1.Text = "0") Or (a = 1) Then
x = CSng(TextBox1.Text)
TextBox1.Clear()
a = 0
EndIf
If a = 3 Then
TextBox1.Clear()
a = 0
EndIf
TextBox1.Text = TextBox1.Text & "3"
EndSub
PrivateSub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
If (TextBox1.Text = "0") Or (a = 1) Then
x = CSng(TextBox1.Text)
TextBox1.Clear()
a = 0
EndIf
If a = 3 Then
TextBox1.Clear()
a = 0
EndIf
TextBox1.Text = TextBox1.Text & "4"
EndSub
PrivateSub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
If (TextBox1.Text = "0") Or (a = 1) Then
x = CSng(TextBox1.Text)
x = CSng(TextBox1.Text)
TextBox1.Clear()
a = 0
EndIf
If a = 3 Then
TextBox1.Clear()
a = 0
EndIf
TextBox1.Text = TextBox1.Text & "5"
EndSub
PrivateSub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
If (TextBox1.Text = "0") Or (a = 1) Then
x = CSng(TextBox1.Text)
TextBox1.Clear()
a = 0
EndIf
If a = 3 Then
TextBox1.Clear()
a = 0
EndIf
TextBox1.Text = TextBox1.Text & "6"
EndSub
PrivateSub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
If (TextBox1.Text = "0") Or (a = 1) Then
x = CSng(TextBox1.Text)
TextBox1.Clear()
a = 0
EndIf
If a = 3 Then
TextBox1.Clear()
a = 0
EndIf
TextBox1.Text = TextBox1.Text & "7"
EndSub
PrivateSub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
If (TextBox1.Text = "0") Or (a = 1) Then
x = CSng(TextBox1.Text)
TextBox1.Clear()
a = 0
EndIf
If a = 3 Then
TextBox1.Clear()
a = 0
EndIf
TextBox1.Text = TextBox1.Text & "8"
EndSub
PrivateSub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
If (TextBox1.Text = "0") Or (a = 1) Then
x = CSng(TextBox1.Text)
TextBox1.Clear()
a = 0
EndIf
If a = 3 Then
TextBox1.Clear()
a = 0
EndIf
TextBox1.Text = TextBox1.Text & "9"
EndSub
PrivateSub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
If (TextBox1.Text = "0") Or (a = 1) Then
x = CSng(TextBox1.Text)
TextBox1.Clear()
a = 0
EndIf
If a = 3 Then
TextBox1.Clear()
a = 0
EndIf
TextBox1.Text = TextBox1.Text & "0"
EndSub
PrivateSub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
If ((InStr(TextBox1.Text, ".")) = 0) Then
TextBox1.Text = TextBox1.Text & "."
EndIf
EndSub
PrivateSub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click
TextBox1.Text = "0"
c = 1
b = 0
x = 0
EndSub
PrivateSub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
If c = 1 Then
x = CSng(TextBox1.Text) + 0
c = 0
TextBox1.Text = CStr(x)
b = 1
a = 1
EndIf
If b = 0 Then
x = CSng(TextBox1.Text) + 0
TextBox1.Text = CStr(x)
b = 1
a = 1
EndIf
If b = 2 And a = 0 Then
x = x - CSng(TextBox1.Text)
TextBox1.Text = CStr(x)
b = 1
a = 1
EndIf
If b = 1 And a = 0 Then
x = x + CSng(TextBox1.Text)
TextBox1.Text = CStr(x)
b = 1
a = 1
EndIf
If b = 3 And a = 0 Then
x = CSng(TextBox1.Text) * x
TextBox1.Text = CStr(x)
b = 1
a = 1
EndIf
If b = 4 And a = 0 Then
If TextBox1.Text = "0"Then
TextBox1.Text = "ERROR"
a = 3
x = 0
c = 1
b = 0
Else
x = x / CSng(TextBox1.Text)
TextBox1.Text = CStr(x)
EndIf
EndIf
EndSub
PrivateSub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
If b = 1 Then
x = CSng(TextBox1.Text) + x
TextBox1.Text = CStr(x)
b = 0
EndIf
If b = 2 Then
x = x - CSng(TextBox1.Text)
TextBox1.Text = CStr(x)
b = 0
EndIf
If b = 3 Then
x = CSng(TextBox1.Text) * x
TextBox1.Text = CStr(x)
b = 0
EndIf
If b = 4 Then
If TextBox1.Text = "0"Then
TextBox1.Text = "ERROR"
a = 3
x = 0
c = 1
b = 0
Else
x = x / CSng(TextBox1.Text)
TextBox1.Text = CStr(x)
EndIf
b = 0
EndIf
EndSub
PrivateSub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
If c = 1 Then
x = CSng(TextBox1.Text) - 0
c = 0
TextBox1.Text = CStr(x)
b = 2
a = 1
EndIf
If b = 0 Then
x = CSng(TextBox1.Text) - 0
TextBox1.Text = CStr(x)
b = 2
a = 1
EndIf
If b = 2 And a = 0 Then
x = x - CSng(TextBox1.Text)
TextBox1.Text = CStr(x)
b = 2
a = 1
EndIf
If b = 1 And a = 0 Then
x = x + CSng(TextBox1.Text)
TextBox1.Text = CStr(x)
b = 2
a = 1
EndIf
If b = 3 And a = 0 Then
x = CSng(TextBox1.Text) * x
TextBox1.Text = CStr(x)
b = 2
a = 1
EndIf
If b = 4 And a = 0 Then
If TextBox1.Text = "0"Then
TextBox1.Text = "ERROR"
a = 3
x = 0
c = 1
b = 0
Else
x = x / CSng(TextBox1.Text)
TextBox1.Text = CStr(x)
EndIf
EndIf
EndSub
PrivateSub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = TimeOfDay
EndSub
PrivateSub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
If c = 1 Then
x = CSng(TextBox1.Text) * 1
c = 0
TextBox1.Text = CStr(x)
b = 3
a = 1
EndIf
If b = 0 Then
x = CSng(TextBox1.Text) * 1
TextBox1.Text = CStr(x)
b = 3
a = 1
EndIf
If b = 2 And a = 0 Then
x = x - CSng(TextBox1.Text)
TextBox1.Text = CStr(x)
b = 3
a = 1
EndIf
If b = 1 And a = 0 Then
x = x + CSng(TextBox1.Text)
TextBox1.Text = CStr(x)
b = 3
a = 1
EndIf
If b = 3 And a = 0 Then
x = CSng(TextBox1.Text) * x
TextBox1.Text = CStr(x)
b = 3
a = 1
EndIf
If b = 4 And a = 0 Then
If TextBox1.Text = "0"Then
TextBox1.Text = "ERROR"
a = 3
x = 0
c = 1
b = 0
Else
x = x / CSng(TextBox1.Text)
TextBox1.Text = CStr(x)
EndIf
EndIf
EndSub
PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
c = 1
EndSub
PrivateSub Button14_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
If c = 1 Then
x = CSng(TextBox1.Text) / 1
c = 0
TextBox1.Text = CStr(x)
b = 4
a = 1
EndIf
If b = 0 Then
x = CSng(TextBox1.Text) / 1
TextBox1.Text = CStr(x)
b = 4
a = 1
EndIf
If b = 2 And a = 0 Then
x = x - CSng(TextBox1.Text)
TextBox1.Text = CStr(x)
b = 4
a = 1
EndIf
If b = 1 And a = 0 Then
x = x + CSng(TextBox1.Text)
TextBox1.Text = CStr(x)
b = 4
a = 1
EndIf
If b = 3 And a = 0 Then
x = CSng(TextBox1.Text) * x
TextBox1.Text = CStr(x)
b = 4
a = 1
EndIf
If b = 4 And a = 0 Then
If TextBox1.Text = "0"Then
TextBox1.Text = "ERROR"
a = 3
x = 0
c = 1
b = 0
Else
x = x / CSng(TextBox1.Text)
TextBox1.Text = CStr(x)
EndIf
EndIf
EndSub
EndClass
هم اکنون 1 کاربر در حال مشاهده این تاپیک میباشد. (0 کاربر عضو شده و 1 مهمان)