Reading: Chapter 7.
Due At 10pm, February 10, 2005. Late work will be accepted for 48 hours past the due date, with a one point penalty for each hour late.
The classes you create must include:
All inputs values will be white space delimited. The main program is intended to be an interactive test program for your other classes, so some type of simple prompt would be appropriate.
In addition your program must support a command line arugment of -q for quiet mode. In quite mode, no prompt is printed. This is intended to be used for testing where input comes from a file (via file redirection) and output also goes to a file (via file redirection).
f 1111 60 25 r 100 2 2 50 20 p 300 3 1 1 30 10 15 20 d f 2222 70 40 r 100 3 2 50 20 l 200 12 2 50 20 d s 1111 x 100 d
enter command>f 1111 60 25 enter command>r 100 2 2 50 20 enter command>p 300 3 1 1 30 10 15 20 enter command>d ************************************************************** * * * ** * * ****---------------------------------------------| * * * **** | * * |* *** | * * | * *** | * * | * *** | * * | * *** | * * | * **** | * * | * *** | * * | * ** | * * | * ** | * * | * * | * * | * ** | * * | * * | * * | * ** | * * | * * | * * | * ** | * * | * * | * * | * ** | * * | * | * * |------------------------------------------------| * * * * * * * ************************************************************** enter command>f 2222 70 40 enter command>r 100 3 2 50 20 enter command>l 200 12 2 50 20 enter command>d ************************************************************************ * * * * * |--------**--------------------------------------| * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * | *** | * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * |------------------------------------------------| * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ************************************************************************ enter command>s 1111 ************************************************************** * * * ** * * ****---------------------------------------------| * * * **** | * * |* *** | * * | * *** | * * | * *** | * * | * *** | * * | * **** | * * | * *** | * * | * ** | * * | * ** | * * | * * | * * | * ** | * * | * * | * * | * ** | * * | * * | * * | * ** | * * | * * | * * | * ** | * * | * | * * |------------------------------------------------| * * * * * * * ************************************************************** enter command>x 100 enter command>d ************************************************************** * * * ** * * **** * * * **** * * * *** * * * *** * * * *** * * * *** * * * **** * * * *** * * * ** * * * ** * * * * * * * ** * * * * * * * ** * * * * * * * ** * * * * * * * ** * * * * * * * * * * * * ************************************************************** enter command>
f 1111 60 25 r 100 3 2 10 20 l 200 2 2 50 20 p 300 3 1 1 30 10 15 20 d f 2222 70 40 r 100 3 2 50 20 l 200 12 2 50 20 d s 1111 x 100 dIf the above was used via file redirection and quiet mode, the output would be as shown below.
************************************************************** * * * ** * * ****------| * * *|****** | * * * *** *** * * |* ***|*** * * | * ** *** * * | * | *** *** * * | * | *** **** * * | * | ** *** * * | * | *** ** * * | * | ***** * * | * | *** * * | * | ** *** * * | *| * *** * * | *| ** ** * * | * * *** * * | |* ** *** * * | | * * ** * * | | * ** *** * * | | * ** * * |--------| * * * * * * * ************************************************************** ************************************************************************ * * * * * |--------**--------------------------------------| * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * | *** | * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * | ** | * * |------------------------------------------------| * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ************************************************************************ ************************************************************** * * * ** * * ****------| * * *|****** | * * * *** *** * * |* ***|*** * * | * ** *** * * | * | *** *** * * | * | *** **** * * | * | ** *** * * | * | *** ** * * | * | ***** * * | * | *** * * | * | ** *** * * | *| * *** * * | *| ** ** * * | * * *** * * | |* ** *** * * | | * * ** * * | | * ** *** * * | | * ** * * |--------| * * * * * * * ************************************************************** ************************************************************** * * * ** * * **** * * * ****** * * * *** *** * * * *** *** * * * ** *** * * * *** *** * * * *** **** * * * ** *** * * * *** ** * * * ***** * * * *** * * * ** *** * * * * *** * * * ** ** * * * * *** * * * ** *** * * * * ** * * * ** *** * * * ** * * * * * * * * * **************************************************************