Assignment 1
CISC221, Fall 2001
Queen's University
Due: October 10, 2001 12:00
Where: In drop-off box marked cisc221 outside Goodwin 235
No late assignments!
See below notes for instructions.
Develop a program in java that converts the input of a decimal character string into the following output:
The input is to be interpreted as the value of a PEP/6 integer, which is exactly 16 bits wide. So if a decimal is too large to fit into sixteen bits, it should be flagged as an error. Your program should implement it's own base conversions using one of the methods suggested in class, not using ANY conversions native to java! You may however use native java print commands to convert values to characters.Be careful to check for unprintable characters first!
If the input cannot be interpreted as a number, the program should print an error message.
You don't have to expend any effort on the user interface. Just have the program read constants line-by-line from its standard input, and print to the standard output.
Your program should convert the characters in the input string to decimal by
checking position of the character.
Then use this value as input for methods that implement the base conversion
printouts.
Be sure to test your program with a number of representative test cases and explain your motivation for those test cases. Include the test results and motivations as a single hardcopy documentation page that you hand in with your code.
Your (hard-copy) submission should include: The printout of one *.java file and one documentation file. Remember to include comments in your program code. Make sure your name and student number are on every page. Please number and staple pages together in a way that allows us to read them. For a complete overview of instructions regarding submission, see Assignments