For those who wish to practice / have the need for use of octal numerals in JAVA, I've authored a simple program a few minutes ago which you can use to convert octal to decimal for your own implementation. This has been uploaded to my GitHub and available for public use. :-)
There could be many other types of APIs available (authored by other programmers) with broader scope in relevance to octal numeral system (and/or hexadecimals), so if you're looking for other ready-made functions, make sure to research those as well. However, if you're looking for something simple that you can expand, this program might just be what you're looking for.
Here's the content of the plain version:
There could be many other types of APIs available (authored by other programmers) with broader scope in relevance to octal numeral system (and/or hexadecimals), so if you're looking for other ready-made functions, make sure to research those as well. However, if you're looking for something simple that you can expand, this program might just be what you're looking for.
Here's the content of the plain version:
Notice that in the for-loop, I have used double initiators and double control variables with reversed direction to make the counter variables run at the same time (for simple implementation). But there's only one real mover here and that's the i; the initial value is changed at every run to the next digit as j decrements along with the i. (^^,)
Try it out and see (suggestions are always welcome).
https://github.com/kucxgithub/octal
The program version with error-checks which continually prompts the user for an octal until a valid input gets entered is also available from the same repository page of this program, please consult the GitHub URL provided above.
For reference to conversion table, you can check out https://ascii.cl/conversion.htm
Sample Output of Plain Version:
Try it out and see (suggestions are always welcome).
https://github.com/kucxgithub/octal
The program version with error-checks which continually prompts the user for an octal until a valid input gets entered is also available from the same repository page of this program, please consult the GitHub URL provided above.
For reference to conversion table, you can check out https://ascii.cl/conversion.htm
Sample Output of Plain Version:
Sample Output of Version with Error-Checks:
Happy Coding! :-)