- Problem 2 Arithmetic Expression Evaluation Given A String Containing An Infix Form Arithmetic Expression Which Contai 1 (50.39 KiB) Viewed 38 times
• Problem 2: Arithmetic Expression Evaluation Given a string containing an infix-form arithmetic expression which contai
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
• Problem 2: Arithmetic Expression Evaluation Given a string containing an infix-form arithmetic expression which contai
• Problem 2: Arithmetic Expression Evaluation Given a string containing an infix-form arithmetic expression which contains Single digit number (i.e. from 0 to 9) • Operators such as +, -, *,/ Parentheses. Write a program to evaluate and display on screen result of the expression. Instruction for Problem 2: (Follow instructions step-by-step) • Re-create, re-compile and re-run Java projects (postfix, infix). • Extend the program by allowing multiple digit numbers in expressions such as 123+56*78-1. You need to extract the token before determining what type it belongs to. For example you need to treat 123 as a single token but not 3 tokens (1, 2, and 3). Hints: just use a loop. • Extend the program by allowing not only constant numbers but also variables. You may ask user input variables' values when evaluating expression. You should start with a simple solution first, although it's not good. Don't try a highly complicated solution immediately.