Page 1 of 1

Problem Description A base-7 is a number composed using the base-7 numeral system which consists of only seven symbols:

Posted: Fri Jul 08, 2022 6:36 am
by answerhappygod
Problem Description A Base 7 Is A Number Composed Using The Base 7 Numeral System Which Consists Of Only Seven Symbols 1
Problem Description A Base 7 Is A Number Composed Using The Base 7 Numeral System Which Consists Of Only Seven Symbols 1 (66.91 KiB) Viewed 47 times
Problem Description A base-7 is a number composed using the base-7 numeral system which consists of only seven symbols: commonly "0" (zero), "1" (one), "2" (two), "3" (three), "4" (four), "5" (five), and "6" (six). For instance, the 7-based number 11517 corresponds to the decimal number 428. With the help of stacks, one can convert decimal values to numbers in the base-7 system. The following is the process of converting 428 to base-7 number using stack: Process Remainder Result Stack (top -> bottom) 61 428 divide by 7 1 61 divide by 7 51 8 divide by 7 151 1 divide by 7 1151 8 1 0 1 LO 5 1 1 0 Stop Pop and display all elements from stack: 1151 Write a java program that converts a decimal to an equivalent base-7 number using stack data structure.
Input A non-negative decimal number that less than 10000. Output An equivalent Base-7 number. Sample Input-Output Input 428 Output 1151