![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Oct 2006
Posts: 19
Rep Power: 0
![]() |
[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.
![]() 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. |
|
|
|
|
|
#2 |
|
Professional Programmer
|
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. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Oct 2006
Posts: 19
Rep Power: 0
![]() |
ok, is that stuff beginer friendly? I'm just getting to the point i learn about loops. thx.
|
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#5 |
|
Newbie
Join Date: Oct 2006
Posts: 19
Rep Power: 0
![]() |
any site reccomendations?
|
|
|
|
|
|
#6 |
|
Sexy Programmer
|
__________________
I would love to change the world, but they won't give me the source code! |
|
|
|
|
|
#7 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Not really, I haven't done one in a couple years. Here's a look at an expression tree.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#8 |
|
Expert Programmer
|
That doesnt look anything like the windows calculator :p. jk and good luck
![]()
__________________
|
|
|
|
|
|
#9 |
|
Programming Guru
![]() |
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). |
|
|
|
|
|
#10 |
|
Hobbyist Programmer
|
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!
__________________
Pain is just weakness leaving the body.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programming video game to TI calculator? | magus57 | Project Ideas | 20 | May 5th, 2006 10:19 PM |
| calculator | TecBrain | Java | 2 | Dec 28th, 2005 1:21 PM |
| Calculator Multiple Operations? | jl13 | C# | 5 | Oct 12th, 2005 4:32 PM |
| Javascript calculator | narroweyes | JavaScript and Client-Side Browser Scripting | 7 | Jul 30th, 2005 12:46 PM |
| my Calculator | layer | Other Scripting Languages | 4 | Mar 9th, 2005 7:09 PM |