954,558 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help with scientific calculator

Our instructor told us to make a scientific calculator using visual basic... though he didn't yet discuss on how... what i made was just a simple calculator that can perform the four basic functions... here is my codes...

Dim val1 As Double
Dim a As Double, s As Double, m As Double, d As Double
'for addition
Private Sub Command1_Click()
If val1 <> 0 Then
    Text1.Text = (a + Text1.Text) + (s - Text1.Text) + (m * Text1.Text) + (d / Text1.Text)
End If
a = Text1.Text
s = 0
m = 1
d = 0
val1 = Text1.Text
End Sub
'for subtraction
Private Sub Command2_Click()
If val1 <> 0 Then
    Text1.Text = (a + Text1.Text) + (s - Text1.Text) + (m * Text1.Text) + (d / Text1.Text)
End If
a = 0
s = Text1.Text
m = -1
d = 0
val1 = Text1.Text
End Sub
'for multiplication
Private Sub Command3_Click()
If val1 <> 0 Then
    Text1.Text = (a + Text1.Text) + (s - Text1.Text) + (m * Text1.Text) + (d / Text1.Text)
End If
a = 0
s = 0
m = Text1.Text
d = 0
val1 = Text1.Text
End Sub
'for division
Private Sub Command4_Click()
If val1 <> 0 Then
    Text1.Text = (a + Text1.Text) + (s - Text1.Text) + (m * Text1.Text) + (d / Text1.Text)
End If
a = 0
s = 0
m = 0
d = Text1.Text
val1 = Text1.Text
End Sub
'for equal
Private Sub Command5_Click()
If val1 <> 0 Then
    Text1.Text = (a + Text1.Text) + (s - Text1.Text) + (m * Text1.Text) + (d / Text1.Text)
End If
a = 0
s = 0
m = 1
d = 0
val1 = Text1.Text
End Sub


i hope someone could help me make a scientific calculator.... Adding only %, Oct, factorial, squared, cubed, hex (A,B,C,D,E,F) i think that's it... hope someone could help... thanks in advance

PolarClaw
Newbie Poster
7 posts since Jul 2006
Reputation Points: 10
Solved Threads: 0
 

anyone? help please?

PolarClaw
Newbie Poster
7 posts since Jul 2006
Reputation Points: 10
Solved Threads: 0
 

Ok.... I'm not sure exactly what it's going to entail.... do you have the buttons already added for the scientific portion? Attach your project to the next post, and we'll go from there.

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

I'm sorry for the inconvenience... but i finally figured it out... with the help of some friends... hehehehe.... thanks anyway for your time...

PolarClaw
Newbie Poster
7 posts since Jul 2006
Reputation Points: 10
Solved Threads: 0
 

i need help with a scientific calcu. um i dont know exactly how im supposed to start as there are characters in the calcu i cannot show in the buttons like the square root and the like. please help me. i know the codes for the simple operands + - / * and the square root code. but for the sin, cosine, tan and the like, i do not know how.

jenmedina
Newbie Poster
9 posts since Jan 2009
Reputation Points: 19
Solved Threads: 0
 

How about you don't post to three year old threads, that have already been marked solved..... dufus.

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 
How about you don't post to three year old threads, that have already been marked solved..... dufus.

dear comatose,

sorry. it's just that even if it said it's already solved, i couldn't figure out the codes. im an accounting major. and besides, its currently, my assignment when i searched the engine and found some threads, i didn't realize it was ages ago. if it was years ago then why didn't they lock it? don't call me a dufus. it's not polite.

jenmedina
Newbie Poster
9 posts since Jan 2009
Reputation Points: 19
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You