AP Computer Science Rules

Credit: You get up to 10 extra credit points depending on how well your code works, how well it is commented, how elegantly it is written, etc. Include a comment at the top, as usual, describing how the program went for you and how long it took. If you wrote pseudocode or did any scratchwork on paper, hand that in too. E-mail me your code and give me paper copies of any pseudocode or scratchwork.

Input: Valid input includes two formats.
Numbers without repeating decimals. For example,
5
003.14
0.40
.509822
Numbers with repeating decimals. For example,
0.[3] means 0.33333333333...
9.123[45] means 9.12345454545...
.119[984] means 0.119984984984...
Output: Output is the reduced fraction form of the input, written as a fraction.

Handling Exceptions: Your program should catch any invalid user input, print an appropriate error message, and ask the user to re-enter. Invalid input is anything other than what is shown above for valid input.

Other details: