Hack Forums
[Java] Java Base Converter/calculator - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Java] Java Base Converter/calculator (/showthread.php?tid=5039604)



Java Base Converter/calculator - Accoy - Oct 29, 2015

Hello all. Can you tell me how to improve this converter and calculator? This either adds, multiplies, divides, or subtracts either decimals, binary, hexa, or octal values. When you choose 2 base forms you want to, for example, multiply, it will give you the answer for all types. Here is the source code:
http://pastebin.com/mZN5nyh4
Tell me what you think.
Screenshot: https://i.imgur.com/punKVuX.png


* - Mankey - Oct 29, 2015

You can probably make a GUI out of it so it is not in that Text Format :) I can probably help as well! I'm learning about GUI's in college so it's good to practice!


* - StayTech666 - Oct 30, 2015

(Oct 29, 2015 07:02 PM)Mankey Wrote:  You can probably make a GUI out of it so it is not in that Text Format :) I can probably help as well! I'm learning about GUI's in college so it's good to practice!

I definitely wouldn't recommend making a GUI until you learn a bit more, specifically about creating classes and methods. Instead of having all of that code in your main class, try creating methods or classes that will perform these operations for you.