একটি VB প্রোগ্রাম লিখুন যা উইন্ডোজ ক্যালকুলেটর প্রোগ্রামের মৌলিক ফাংশন এবং আচরণকে অনুকরণ করে। তার ইন্টারফেসটি অধ্যয়ন করতে, আপনি টাস্কবারের স্টার্ট বাটনে ক্লিক করে রান করতে পারেন, তারপর প্রোগ্রামগুলিতে যান, তারপর Accessories এ যান। আপনি কমপক্ষে যোগফল, বিয়োগ এবং গুণের মৌলিক ফাংশনকে সমর্থন করতে, সেইসাথে সংখ্যা (+/- key) এর চিহ্ন পরিবর্তন করা উচিত। আপনি যদি sqrt,%, এবং 1 / x ফাংশনগুলি সমর্থন করতে চান তবে এটি আপনার উপরে থাকবে। বাম (এমসি, এমআর, এমএস, এম +) বা বৈজ্ঞানিক বৈশিষ্ট্যগুলির "এম" কী দিয়ে বিরক্ত করবেন না।
(Write a VB program that simulates the basic functions and behavior of the Windows calculator program. To study its interface, you can run it by clicking the Start button on the taskbar, then go to Programs, then Accessories. You should at least support the basic functions of addition, subtraction, and multiplication, as well as changing the sign of the number (the +/- key). It's up to you if you want to support the sqrt, %, and 1/x functions. Don't bother with the "M" keys on the left (MC, MR, MS, M+) or the scientific features.)
(Write a VB program that simulates the basic functions and behavior of the Windows calculator program. To study its interface, you can run it by clicking the Start button on the taskbar, then go to Programs, then Accessories. You should at least support the basic functions of addition, subtraction, and multiplication, as well as changing the sign of the number (the +/- key). It's up to you if you want to support the sqrt, %, and 1/x functions. Don't bother with the "M" keys on the left (MC, MR, MS, M+) or the scientific features.)


























Simple Fraction calculator
Here's the code for simple calulator
Dim Opr As String
Text1.Text = Text1.Text + Command1.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
End Sub
Text1.Text = Text1.Text + Command2.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
Text1.Text = Text1.Text + Command3.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
Text1.Text = Text1.Text + Command4.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
Text1.Text = Text1.Text + Command5.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
Text1.Text = Text1.Text + Command6.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
Text1.Text = Text1.Text + Command7.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
Text1.Text = Text1.Text + Command8.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
Text1.Text = Text1.Text + Command9.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
End Sub
Text1.Text = Text1.Text + Command10.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
End Sub
Private Sub CommandDot_Click()
If InStr(Text1.Text, ".") Then
Exit Sub
Else
Text1.Text = Text1.Text + "."
End If
End Sub
Text1.Text = ""
End Sub
Op1 = Val(Text1.Text)
Opr = "+"
Text1.Text = ""
End Sub
Op1 = Val(Text1.Text)
Opr = "-"
Text1.Text = ""
End Sub
Op1 = Val(Text1.Text)
Opr = "*"
Text1.Text = ""
End Sub
Op1 = Val(Text1.Text)
Opr = "/"
Text1.Text = ""
End Sub
Op2 = Val(Text1.Text)
Select Case Opr
Case "+": Text1.Text = Op1 + Op2
Case "*": Text1.Text = Op1 * Op2
Case "-": Text1.Text = Op1 - Op2
Case "/": Text1.Text = Op1 / Op2
End Select
End Sub
End
End Sub
Text1.Text = ""
End Sub
Visual basic 6.0
Here's the code for simple calulator
Dim Opr As String
Text1.Text = Text1.Text + Command1.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
End Sub
Text1.Text = Text1.Text + Command2.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
Text1.Text = Text1.Text + Command3.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
Text1.Text = Text1.Text + Command4.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
Text1.Text = Text1.Text + Command5.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
Text1.Text = Text1.Text + Command6.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
Text1.Text = Text1.Text + Command7.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
Text1.Text = Text1.Text + Command8.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
Text1.Text = Text1.Text + Command9.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
End Sub
Text1.Text = Text1.Text + Command10.Caption
If cleardisplay Then
Text1.Text = ""
cleardisplay = False
End If
End Sub
Private Sub CommandDot_Click()
If InStr(Text1.Text, ".") Then
Exit Sub
Else
Text1.Text = Text1.Text + "."
End If
End Sub
Text1.Text = ""
End Sub
Op1 = Val(Text1.Text)
Opr = "+"
Text1.Text = ""
End Sub
Op1 = Val(Text1.Text)
Opr = "-"
Text1.Text = ""
End Sub
Op1 = Val(Text1.Text)
Opr = "*"
Text1.Text = ""
End Sub
Op1 = Val(Text1.Text)
Opr = "/"
Text1.Text = ""
End Sub
Op2 = Val(Text1.Text)
Select Case Opr
Case "+": Text1.Text = Op1 + Op2
Case "*": Text1.Text = Op1 * Op2
Case "-": Text1.Text = Op1 - Op2
Case "/": Text1.Text = Op1 / Op2
End Select
End Sub
End
End Sub
Text1.Text = ""
End Sub