CS30 -- Introduction to Computer Science II
Fall, 2004
Assignment 11
(updated 11/30/2004)


Programming Project:
Write a Java program to answer Programming Project 6 in Chapter 10, page 265 of your text.  The problem involves converting a mathematical expression from infix to postfix notation.  You may ignore standard operator precedence.  However, if the infix expression contains parentheses then you should convert to postfix according to the precence implicit in the parentheses.

You may assume that there will be one or more spaces between tokens (numbers, operators and parentheses).  However, if you write your code so that you can handle expressions without spaces, you'll get extra credit.

I'm hoping you'll find this to be a relatively simple program and a nice break from the Eden project.  If for some reason you find this assignment too challenging, I suggest you drop the parentheses handling.  In other words, you will get substantial partial credit if you correctly convert expressions that do not contain parentheses at all. 

Sample input and output:

3 + 5 * 7 should convert to 3 5 + 7 *
3 * 12 + 4 should convert to 3 12 * 4 +
3 * ( 12 + 4 ) should convert to 3 12 4 + *

Submission Instructions:
On your machine where you are doing your homework, create a folder called <your email name> followed by "A11".  For example, someone with email address "cjones" would create a folder called "cjonesA11".  Inside that folder, place plain text file(s) containing your answers to any exercises.  Also, place whatever Java files are necessary for your Programming Projects in the same folder.  Finally, either tar or zip the folder so that when I extract it, the folder "<emailname>A11" will be createdIf you choose to use zip instead of tar, change the extension of the resulting zip file from "<something>.zip" to "<something>.foo".  This way, our webmail will allow you to attach the file.  If I get an attachment with extension .foo, I will change it back to .zip and all should be well.