Computer Science II

PA 02

Fixing your "Simple Class" from PA01

 and using the command line for testing It


Due by Monday, September 10th

[9:00 AM  for code and paperwork]


Tasks

  1. Based on the feedback you received on your paperwork for PA01, and based on in class discussions during Session 6 and Session 7, make the appropriate modifications to your BoundedInteger.java class from PA01.  Make sure that all functionality is present and that all "design issues" are corrected.
  2. Create a new class called BoundedIntegerCLTest.java.  This class is designed to be a test of the mathematical operators that are part of BoundedInteger and gets its "instructions" from the command line at run time.  Run time arguments are expected to follow these rules:

Thus, the following are all legal invocations of this class

While the following are not

There certainly are other cases and you will need to consider which are and are not legal.

Challenge/Bonus

Modify BoundedIntegerCLTest.java so that it can handle multiple commands provided at the command line. 

For example,

Would produce a BoundedInteger whose value is 10, then add 2 to get 12, then add 3 to get 15, and then subtract 4 to get 11. 

Once again, if the command is incorrect you should print an error message.

 


Deliverables

By the due date and time, submit the files

Shortly after this, you will submit paper printouts of your code.

Be sure that your submission follows all homework submission requirements.