******************************************************************************* 0) Administrative - hw: 10.1-2 - A4 questions? A4 hints: * The ONLY THINGS that may be static are main and console input stuff * Main gets the filenames, makes sure they fit the requirements, then makes a POSCalculator object and tells it to process the files * You MUST HAVE more than one or two instance methods to keep reasonable length * You'll have some sort of "process" method with a loop that reads the lines * Example: a separate method to process one line * Continue by taking logical chunks out of that one to make others * A method here will be a little longer than before, but should fit on a page * What to do when you look at a line? Ex: 3 + 4 - 1 = a) Have you seen anything yet? If not, you expect a left operand. Store it and note that you've got one. - data members? double and boolean b) If you've seen a left operand, have you seen an operator yet? If not, you expect one. Store it and note that you've got one. - data members? char and boolean c) If you've seen an operator, you expect a right operand. Calculate and store the result as a left operand. Unmark the operator. - data members? none d) What if you see an equals? There must be something in the left operand, a value that's just been calculated, and you should print it to the file. - trickiness with handling end of file * Remember to initialize all these data members in the constructor * How do you tell whether the line has a double or an operator? - try to parse it. try block assumes it worked and handles operands, catch block knows it didn't and handles operators 1) Last time- file I/O - finish up stuff 2) Exam review A. Specific questions? B. Review answers C. Recent lab exercises 3) Pointers - it's not tricky, but it's hard; mind the details - work carefully, write out each step you take, and check your answers later - play computer to work out loops and to check your written answers - go over A2 and A3 so they're fresh in your mind - do a string processing exercise from scratch for practice *******************************************************************************