![]() |
[vbasic] Calculator
I'm trying to make a calculator in visual basic. I'm trying to make it look like the windows calc. Is it possible, I'll show a screenshot.
http://img207.imageshack.us/my.php?image=calc1pn2.jpg In the pic, you see my ui. I'm trying to make it look like calculator. I will put a logo in the upper right. I have no code, except for the close button, and clear. I need help knowing if i can do this project in bb, and how to make it like calc, in that you press a button another one, and then another one, and finally =, it'll display the answer, OR, it'll function in displaying like a graphing calc, in that you press the #'s and function, it shows the history of options, e.g. 5-7=-2 below, 6/2=3, etc... Please help and give suggestions, thanks. |
You're going to want to take a look at Infix and Postfix expressions, also known as Reverse Polish Notation.
There's some pretty basic algorithms for evaluating an expression in Postfix format, once you've got it there. Before you get any further, you're going to need to get those basics covered. |
ok, is that stuff beginer friendly? I'm just getting to the point i learn about loops. thx.
|
Trees and stacks are handy, too. You may be a little ahead of yourself, but good luck with it. I would say you have a lot of research and surfing to do, because it isn't going to get built in a thread.
|
any site reccomendations?
|
|
Not really, I haven't done one in a couple years. Here's a look at an expression tree.
|
That doesnt look anything like the windows calculator :p. jk and good luck :D
|
If you're just starting with loops, then this will probably send you in way over your head. A calculator, as basic as it is in theory, can be complicated to program when being done in the same manner as a scientific/windows calculator. I'd first get more comfortable with the language itself. Especially if this is your first programming language, which I can assume is.
I'd first try something simpler like a four operation calculator. In this calculator, there's two number fields and a button for each operation: "+-*/". Each of those buttons evaluates the respective operation for the two operands (extracted from the two number fields). |
Why do you need a 'close' button, thats what the red 'x' is for, no? Also might I suggest rearranging those buttons, the standard format is 0 at bottom and 9 at top, can be very confusing to someone used to the standard (such as your keyboard).
Good Luck! |
| All times are GMT -5. The time now is 9:45 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC