Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Calculator project

suelo82suelo82 Member Posts: 1
Anyone out there know how to create a calculator program? My evil profesor for VB is not very helpful and is daming me for being inferior to him. Any help would be appreciated.

e-mail: suelo82@hotmail.com
Name: Anthony

Comments

  • GideonOmegaGideonOmega Member Posts: 617
    : Anyone out there know how to create a calculator program? My evil profesor for VB is not very helpful and is daming me for being inferior to him. Any help would be appreciated.
    :
    : e-mail: suelo82@hotmail.com
    : Name: Anthony
    :
    you could make several command buttons with the captions of the numbers and math symbols that you plan to use, a text box for input, then when numbers are pressed append the value indicated by the button into the text box then when a math symbol is pressed assign the value of the text box to a var - as in intValue1 = int(text1.text), have a string var = the Math symbol pressed, then onece another number button is pressed clear the text box and start appending the other numbers, then once the = button is pressed assign the text box text just as above to a different var, do a select case on the string var to determine what aritmatic to do, then output the results to the text box.


    also if you post requests like this in the homework help forum you would probably get more responses.

    Hope this helps.

    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

  • dartmedartme Member Posts: 41
    : : Anyone out there know how to create a calculator program? My evil profesor for VB is not very helpful and is daming me for being inferior to him. Any help would be appreciated.
    : :
    : : e-mail: suelo82@hotmail.com
    : : Name: Anthony
    : :


    Dear Sir

    Calculators are tough, I tried one once a long time ago and gave up because it's too hard. The previous example was fine, however, if I understood it correctly, it completely ignored the order of operations. What I finally wound up doing was opening the Windows Calculator hidden and sending keys to it and copying the result to the clipboard and taking it in my program. Maybe the best thing you could do is think of every formula (or problem or whatever) as a three part thing (I'll the three parts together a formula for now)...a First expression, a Connective then a Second expression : 5+3 . Assuming that you want to make a simple calculator (only +-* and / with maybe even "-" access) this should work. Now then, adding something like (7+8)*9 would be done by calling the First expression a "Formula" and that Formula has three parts:
    Formula * 9
    7+8

    see what I'm saying?
    You can go on like that..
    5-((8*3)+5):

    5 - Formula
    (Formula + 5)
    8*3

    which would be evaulated like this:
    eight times three: 24
    plus five: 29
    Five minus that formula = -24

    Anyway, hope this helps (I'm kind of wondering if you still need help, eh oh well). I'm currently working on a logic program that works exactly like this except with Letters. I need help on it currently because, like I said, it's very hard. Oh yeah, my example is only one, I'm sure, of thousands of possible attacks on it. bye

    Most Sincerely
    Aaron Laws

    ==================================
    I-Forever Programming
    Horn Performance Major
    University of Oklahoma
    ==================================

Sign In or Register to comment.