Course Hero Logo

CSC 130 - Summer 2021 - Assignment 1 - Postfix...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 2 out of 2 pages.

California State University, SacramentoCollege of Engineering and Computer ScienceComputer Science 130:Data Structures and Algorithm AnalysisAssignment #1 – Postfix EvaluatorOverviewFor this assignment, you are going to create a postfix expressionevaluator.Due DateDue June 17, 2021, by 11:59 pm.Your TaskPart 1:InterfaceManipulating strings is not as easy in all programming languages.Java,Visual Basic, and C# all have a 'split' function, but these can a tadtroublesome when parsing a string without whitespace.For example, splitting on spaces is easy for "3 * 4", but not for "3*4". I don't want this assignment to be more difficult for onelanguage than another. As a result, all of your input should be s p a c e do u tso it is easy to parse.Evaluator calc = new Evaluator();double result;result = calc.Evaluate("9 7 – 21 *");System.out.println(result);//The answer will be 42The Evaluator Class must have the following interface. You can add some additional methods if you want.

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 2 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture