Assignment 4
- Complete your Unicalc Command-Line Interface (CLI), to give results
similar to those of the test cases posted below.
- Point values for assignment 4 will be awarded as follows, depending on whether your CLI:
- 5: reads pure numbers and evaluates them
- 5: reads pure units and returns normalized quantities
- 5: reads combined units and numbers (such as 234pounds)
- 5: produces an error message when the expression does not evaluate
- 5: produces a warning when there is a residue after parsable input
- 5: evaluates products of units and numbers, using * and / operators
- 5: produces an error message when the expression is not in the language
- 10: evaluates powers (such as 3^4)
- 10: handles parenthesized expressions
- 10: evaluates sums and differences (and multiply divide) with proper left-right grouping (e.g. 2+3-4+5+6)
- 10: evaluates sums, differences, and products with proper precedence (e.g. 2*3-4+5*6)
- 10: formats Unicalc units nicely (such as 234 kg meter^2 / second^2, not as S expressions)
- 15: evaluates products with juxtaposition denoting multiply (e.g. 234 kg m / second)
- 5: (extra) handles decimal fraction coefficients, not just integers
- 5: (extra) handles scientific notation exponents, e.g. 123.45e-6
- 20: (extra) handles optional whitespace (e.g. 234 kg * meter / second ^ 2)
- (up to)30: (extra) other cool stuff (properly documented for the user and grader)
- In addition, points can be subtracted for gross style and documentation violations. Please say briefly what your functions
do, and format them nicely.
- unicalc-cli-tests.txt (Tests for the command-line interface)
- unicalc-cli-tests-out.txt (Output of tests for the command-line interface)
- unicalc-cli-tests-verbose-out.txt (Verbose output of tests for the command-line interface)