Write a Java or C++ program that will convert an array of char supplied in hex, octal, binary or decimal and print out a the number as a string or array of char in all four formats stated above.

Specifications:

  1. The program cannot perform I/O on integer data types. Example, if x is an integer, the statements System.out.println(x) or printf("%d",x) (or %o, %x etc) or cout << x are not permitted. I/O can only be performed on characters.
  2. The program can only input and output strings or individual characters.
  3. The class is to have public function members (methods) called
  4. Program is not to deal with numbers greater than 32767 or negitive numbers.
  5. The only package / library functions you are allowed to use are I/O of single characters, You may use library functions such as clrscr for output enhancement.
  6. Code must be modularized.
  7. The toNumber method is to convert the input string into an integer using Horners' Method.
  8. The program must contain functions and/or procedures to validate input.
İR. Glass
All Rights Reserved
glassr@ncc.edu