Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java 

[TUT]Your First Calculator in Four Easy Steps[TUT]

Java Calculator

Step 1.
1.1 Open Netbeans, and create new project.
1.2 Title it whatever you want.
1.3 Click "Finish" to start the project.
Spoiler (Click to View)

Step 2.
Put this code in the program:Spoiler (Click to View)

PIC:
Spoiler (Click to View)

You should now have the coding done.

Step 4.
Click "Run" and you should now have a working calculator.
Spoiler (Click to View)

I hope you liked my tutorial. Please give me credits for this code, and thread. Please post a reply.
Nice Calculator, more advanced than the calculator at
http://www.youtube.com/watch?v=ANuuSFY2B...9D83EE3E28
😁
ok cool. thanks for the reply.
What is so 'advanced' about this calculator? It doesn't even check for division by zero. You don't need to, you can let Java print its stack trace to the user, but what are they going to do with that? Catch the exception and recover 'gracefully.'
there is no need to devide by zero. it is a known fact that deviding by zero is impossible. the thing that makes this advanced is that this calculator does not only do one function like addition. it does what ever you request.
(Feb 21, 2010 06:42 PM)eXero Wrote:  there is no need to devide by zero. it is a known fact that deviding by zero is impossible.

I know this... I said you check for division by zero so when the user tries dividing by zero they aren't presented with an ugly stack trace.


Quote:the thing that makes this advanced is that this calculator does not only do one function like addition. it does what ever you request.

That's not advanced, that's what a calculator should be at minimum.
dude, if you dont like my tut get off my thread. this tut id advanced because the most basic calculators that someone makes in java are only able to do one operation, so this one can do all of them. therefore it is advanced.
(Feb 21, 2010 06:42 PM)eXero Wrote:  there is no need to devide by zero.
I think you misunderstood...

lol
(Feb 21, 2010 07:01 PM)eXero Wrote:  dude, if you dont like my tut get off my thread. this tut id advanced because the most basic calculators that someone makes in java are only able to do one operation, so this one can do all of them. therefore it is advanced.

It's not really a tutorial - you never explain how the code works.
well, its simple. it only takes a little reading. it will ask your for a number and then another number and then it asks what operation u would like to do.
Why are you guys constantly flaming him for sharing a calculator he wrote? You don't have to keep bashing him telling him it's "Not advanced enough". It's a calculator.
How is pointing out a lack of explanation flaming?
It just seemed like you guys were flaming him for no reason, all he was doing was sharing his calculator. Nevermind.
(Feb 21, 2010 06:42 PM)eXero Wrote:  there is no need to devide by zero. it is a known fact that deviding by zero is impossible. the thing that makes this advanced is that this calculator does not only do one function like addition. it does what ever you request.

Dividing by zero is not impossible... You can divide 0 by itself, using L'Hôpital's rule...

Anyway, this isn't really advanced, it's a basic calculator, considering it doesn't have things like powers, logs, algebraic expressions, ect.

An advanced calculator should have graphing functions as well as a CAS.

But, nonetheless it's a decent calculator.
But its advanced for a basic calculator the you create when you first learn java. if you dont like it then get off my thread.
If it's an advanced version of a basic calculator then it's still a basic calculator, not an advanced one...

And I never said I didn't like it, I'm just saying it's mislabeled.

As you can see, my calculator, that is more advanced than this one is labeled as basic, because it is.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by ScrewbaccaDec 2, 2016 10:50 AM 19 1,366 Dec 2, 2016 10:50 AM
Last Post: Goodies
[C] by NielyMar 22, 2014 08:21 AM 8 212 Mar 22, 2014 08:21 AM
Last Post: Niely
[.NET] by KeeloFeb 9, 2013 10:39 PM 5 402 Feb 9, 2013 10:39 PM
Last Post: 0xDEAD10CC