If you have done some work on Homework 4
hw4.cxx
. It's OK if it's incomplete, just
turn in whatever you have completed at this point. The command you should use
to turn in your file is
/cs/bin/turnin submit cs2005 hw4 hw4.cxx
If you haven't yet started Homework 4
evaluate_stack_ops()
. This should be pretty easy to write, since the code is given in
the textbook! (page 351). Type this code into your program, (also type
the pre- and post-conditions given on page 349), and add a prototype for the
function at the beginning of your program.
eat_spaces().
This function should read and discard any spaces it encounters in the
input stream, returning when either the input stream goes bad, or when a
non-space character has been reached. eat_spaces()
will be very similar to
eat_white() (which is given on page 789 in the textbook).
Define eat_spaces() as a function in your program, add the
pre-and post-conditions, and add a prototype.
higher_precedence().
This Boolean function takes two arguments, both of which are characters.
Each of these characters will be one of the arithmetic operators
('+', '-', '*',
'/'), or a left parenthesis ('('). higher_precedence() should
return true if the first argument has higher precedence than the second
argument, and false otherwise (interpreting the phrase "higher precedence"
the way it
is normally defined
for arithmetic operators). Code the function, write the pre- and
post-conditions, and add the prototype.
hw4.cxx
. It's OK if it's incomplete, just
turn in whatever you have completed at this point. The command you should use
to turn in your file is
/cs/bin/turnin submit cs2005 hw4 hw4.cxx
You have until Monday, May 3 at 11:59pm to finish this homework and turn in the completed files.