nice, but when I saw advanced I expected something a little more... well... advanced... :)
you should update it and add a GUI :)
you should update it and add a GUI :)
|
Java
[TUT]Your First Calculator in Four Easy Steps[TUT] |
(Nov 14, 2010 09:50 AM)Zeveso Wrote: nice, but when I saw advanced I expected something a little more... well... advanced... :) Here is one with a GUI: https://hackforums.net/showthread.php?tid=283322
Nov 14, 2010 02:27 PM
(This post was last modified: Nov 14, 2010 02:29 PM by eXero.)
(Jan 10, 2011 03:17 AM)Dmaster_773 Wrote: started java today (first language as well) tried to fix division by zero w/o help as challenge You should check if it is 0 before trying to divide them, using your method you will still get an exception. (Jan 10, 2011 09:38 AM)Ben121 Wrote: You should check if it is 0 before trying to divide them, using your method you will still get an exception.wouldn't you need to repeat all the processes (+,*,-,/) just for 0 in that case? and it works fine, and doesn't give an answer (Jan 10, 2011 03:17 AM)Dmaster_773 Wrote: started java today (first language as well) tried to fix division by zero w/o help as challenge What he meant was: if (operator.equals("/")){ if(if num2 == 0){ System.out.prinln("ERROR"); System.out.close(); else{ result = num1/num2; }} Im pretty bad at java, but I think this one is better..!
Jan 12, 2011 05:15 PM
(This post was last modified: Jan 12, 2011 05:15 PM by eXero.)
Motherfucker, read the damn thread post date. This was posted over a year ago, when I was new to hackforums.
I used to be good at Java, but I have moved on to other languages. This was posted when I knew Java real well. |
|
|
| 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 | 210 |
Mar 22, 2014 08:21 AM Last Post: Niely |
| [.NET] by KeeloFeb 9, 2013 10:39 PM | 5 | 401 |
Feb 9, 2013 10:39 PM Last Post: 0xDEAD10CC |