I added code tags to your post and sorted out one long line. Always do the same yourself: doesn't it look better
Always use an informative subject for your threads, and avoid writing ALL UPPER CASE, as in all websites.
What's Tsubo? Several other people have asked related questions recently. You have much too much code in your main method; it ought to be moved into other methods. If you have an incorrect value passed, how do you think you will write an error message? You are actually better off throwing an IllegalArgumentException(←link), if you know how to. Beware of System.exit, which can have nasty effects in multi‑threaded programs.
That's a good grade. Congratulations.
Joshua Braud wrote:It worked fine and I received an A for the assignment last week.
However, Campbell is right. Code is maintainable up to the certain point, later it just gets too complicated without structuring it properly.
Have you been taught about the methods? All that code lacking of methods use.
For instance, it would help if you'd have methods for:
What exactly your instructions say about that part? And what subjects you have covered in the college already?
Joshua Braud wrote:Could you post an example code for me.
How the prompt method could look like. More methods better, that way is easier to cope with the amount of code you need to follow in your head.
From what I can tell, your code won't even compile, right? Properly formatting your code could have helped make the problem easier to spot.
Joshua Braud wrote:We also now have this option: . Implement a loop to keep allowing the user to perform multiple conversions either way I'm stuck
Basically, the assignment say to take the code that you have done so far, and place it within a loop. This way, when you are done with one iteration/conversion, it will go back to the beginning, and do another number.
And BTW, I noticed that your strategy for encountering an error, is to print a message and exit the program. Obviously, you can't do the latter anymore, as you need to go back and do another iteration.