Find Jobs
Hire Freelancers

Infix to Postfix Notation (24 to 48 hours)

$10-30 USD

Cancelled
Posted about 6 years ago

$10-30 USD

Paid on delivery
Design, implement, and test a JAVA program that read infix expressions from a file, [login to view URL], converts the infix expression to postfix notation, and evaluates the postfix expressions. We make the following Simplifying assumptions: 1) All operators and operands are one character long in the original infix expression 2) Allowable operators are +, -, *, / (integer division), ^ (exponentiation). 3) All operators are left associative 3) There are no unary operators 4) Each expression is contained on its own line withing the file 5) Parentheses can of course be used in normal fashion, and blanks should be allowed between symbols The infix expressions below should be read into the program from a file, [login to view URL] 1: 8 + 4 * 2 - 6 2: 7 * 2 - 4 * 3 + 2 * 5 3: 2 * 3 * 4 - 8 + 9 / 3 /3 4: 5 + 7 * 4 - 6 5: 4 * ( 3 + 2 * 4) - 7 6: ( 5 + 7 ) / ( 9 - 5) 7: 3 * ( 5 * ( 5 - 2 ) ) - 9 8: ( ( 5 * ( 4 + 2 ) - ( 8 + 8 ) / 2 ) - 9 ) ^ 3 9: ( ( 5 + 5 * ( 6 - 2 ) + 4 ^ 2 ) * 8 ) 10: ( ( ( 3 ^ 4 ) ) ) Be sure that the program outputs the original infix expression, its postfix equivalent, as well as the evaluation of the postfix expression. All outpout should be sent to a file called csis.txt. The only stack class that should be used in this lab is the ObjectStack class that will be provided in a .txt file. You should use at least the following classes and interface for the project. Driver ObjectStack ObjectStackInterface InfixToPostfix EvalPostfix The only user-defined static function should be main(). No floats, doubles, or scientific notation should be used. The program should be able to handle the following ill-formed expressions, indicating that such an expression is erroneous, identifying the type of error, and going on to process the nest infix expression. 1 + * 2 1 2 * 3 ^ 4 ( 1 + 2 ( 1 + 2 ) * 3 ) You can use Java's Scanner class to open a file for input Required declarations: import java.io.*; import [login to view URL]; public static void mains(String[] args) throws IOException { To open a file for input and create a Scanner Object: Scanner filescan = new Scanner(new File("[login to view URL]")); To read a line from the file using the Scanner object: while ([login to view URL]()) { String buf = fileScan,nextLine(); To close the Scanner object: [login to view URL](); The conversion from infix to postfix will require the comparison of operator priorities. Here's a method that will take an operator as input and retunr its priority: private int priority(char op) { switch (op) { case '^': return 3; case '*': case '/': return 2; case '+': case '-': return 1; default : return 0; } } Every class must have a Javadoc class comment Every method must have a Javadoc method comment Every method parameter must have an @param tag Every method with a return statement must ahve an @return tag Generate the HTML Javadoc documentation Each data structure must implement an interface for that data structure. The interface files must be included. Class Diagram: Driver----> InfixToPostfix ---> | | | ---> ObjectStack -----> <interface> ObjectStackInterface | | --> EvalPostfix ------>
Project ID: 16444020

About the project

5 proposals
Remote project
Active 6 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
5 freelancers are bidding on average $39 USD for this job
User Avatar
Solution within 3-5 hours Thanks.
$40 USD in 1 day
5.0 (464 reviews)
7.0
7.0
User Avatar
Hello, I already did this assignment. The requirements were not exact but the gist is same. I can provide you the solution with your requirements within 12 hours. I can show you my past work before you award project to me. Message me so that we can discuss on it.
$30 USD in 1 day
5.0 (44 reviews)
5.1
5.1
User Avatar
I just read your project. but will you tell me about more. what you want. the source code or Exe file of this program. kindly send me more information . thank you
$40 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
A proposal has not yet been provided
$30 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
San Diego, United States
4.9
21
Payment method verified
Member since Mar 3, 2017

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.