Originally Posted by
weezer562
Completely agree with you, but my assignment was to get both addition and subtraction working using scanner methods. I believe its being used to get us accustomed to this. I really appreciate all the input.
Ok, well we can modify this to do something similar. Once again, if there are spaces between the numbers and symbols, we can use the
next() method while the scanner
hasNext(). Then, if you keep a count of how many times you call that
next() method, you can tell if it is a symbol or number (even are numbers and odd are symbols, starting from 0). You can then do basically the same thing I did above.
That way we are using the scanner methods but still doing the same thing technically.