Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 11th, 2006, 8:40 PM   #1
dwizzle13
Newbie
 
Join Date: Oct 2006
Posts: 19
Rep Power: 0 dwizzle13 is on a distinguished road
[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.
dwizzle13 is offline   Reply With Quote
Old Oct 11th, 2006, 9:26 PM   #2
andro
Professional Programmer
 
Join Date: Oct 2005
Location: California
Posts: 319
Rep Power: 4 andro is on a distinguished road
Send a message via AIM to andro
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.
andro is offline   Reply With Quote
Old Oct 11th, 2006, 9:41 PM   #3
dwizzle13
Newbie
 
Join Date: Oct 2006
Posts: 19
Rep Power: 0 dwizzle13 is on a distinguished road
ok, is that stuff beginer friendly? I'm just getting to the point i learn about loops. thx.
dwizzle13 is offline   Reply With Quote
Old Oct 11th, 2006, 9:46 PM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Oct 11th, 2006, 9:54 PM   #5
dwizzle13
Newbie
 
Join Date: Oct 2006
Posts: 19
Rep Power: 0 dwizzle13 is on a distinguished road
any site reccomendations?
dwizzle13 is offline   Reply With Quote
Old Oct 11th, 2006, 10:29 PM   #6
ReggaetonKing
Sexy Programmer
 
ReggaetonKing's Avatar
 
Join Date: Nov 2005
Location: New Jersey
Posts: 891
Rep Power: 4 ReggaetonKing is on a distinguished road
Send a message via AIM to ReggaetonKing
google?

EDIT:http://www.google.com/search?hl=en&q...=Google+Search
__________________
I would love to change the world, but they won't give me the source code!
ReggaetonKing is offline   Reply With Quote
Old Oct 11th, 2006, 10:31 PM   #7
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Oct 11th, 2006, 10:32 PM   #8
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 597
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
That doesnt look anything like the windows calculator :p. jk and good luck
__________________
Quote:
Originally Posted by DaWei View Post
Well, it's better than Pen Islands url....;)

crawforddavid2006 is offline   Reply With Quote
Old Oct 11th, 2006, 10:40 PM   #9
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,076
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
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).
Sane is offline   Reply With Quote
Old Oct 11th, 2006, 10:51 PM   #10
AntiNinja
Hobbyist Programmer
 
AntiNinja's Avatar
 
Join Date: Jun 2006
Location: The States
Posts: 101
Rep Power: 3 AntiNinja is on a distinguished road
Send a message via AIM to AntiNinja Send a message via Yahoo to AntiNinja
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.
AntiNinja is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming video game to TI calculator? magus57 Project Ideas 20 May 5th, 2006 11:19 PM
calculator TecBrain Java 2 Dec 28th, 2005 2:21 PM
Calculator Multiple Operations? jl13 C# 5 Oct 12th, 2005 5:32 PM
Javascript calculator narroweyes JavaScript and Client-Side Browser Scripting 7 Jul 30th, 2005 1:46 PM
my Calculator layer Other Scripting Languages 4 Mar 9th, 2005 8:09 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:14 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC