Octal converter

  • 9
  • Locked
The public static toOctal(int) method must convert the integer received as an input parameter from the decimal numeral system into octal. And conversely, the public static toDecimal(int) method converts from the octal system into decimal. The methods only work with positive numbers. If the input par
You can't complete this task, because you're not signed in.
Comments (1)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Krisztian
Level 28 , Hungary
4 November 2021, 17:28
Bad formula description( todecimal() ) above you can see the fixed one: i is equal to 0 while (the octal number is not 0) { the decimal number = the decimal number + (remainder of the division of the octal number by 10) * 8 to the power of i the octal number = the octal number / 10 increase i by 1 }