Tokenize a algebraic expr and sorted, JAVA Programming

Assignment Help:

?
• ?read from a file a series of an infix algebraic expressions comprised of constant and variable operands (integers), operands (%, *, /, +, -) and parenthesis. Two slashes (//) represents the beginning of a comment that is not part of the expression
• For each line read:
1. Display the input on the console.
2. Store the expected result in a variable for later comparison. Display the comment.
3. Separate the algebraic expression from the string and then convert the expression to a postfix algebraic expression.
4. Display a list of constants in the expression.
5. Display a list of variables in the expression.
6. Query the user for a value to assign to each the variable (Ask only once for each variable regardless of the number of times it occurs in the expression).
7. Display the postfix expression.
8. Determine and display the numeric result of the expression, using integer math.
9. Determine if the computed answer and the expected result are the same and post an appropriate message.

Coding Standard: The program may use only the Java library Scanner, System, Vector, Arraylist, Linked List, Stack and Java standard file handling classes. The use of arrays is permitted. All input is from a file named “input.dat” and output must be to the Java Console.

Extra explanations;


• It reads in each line of the input file and displays it.
• It correctly identifies and displays all constants used in the expression, including their sign. Note: The minus symbol can indicate either subtraction or a negative constant.
• it displays it the comment to the console.
• it displays a list of all the variables in the expression.
• it queries the user for a value for each variable
• it queries the user for a value for each variable (only once for each occurrence).
• Correctly converts the infix formula into postfix and displays the resulting expression.
• it substitutes the values specified for each variable and displays the new postfix result.
• it correctly resolves postfix and displays the result.
• it writes all output required from the console to a file.


Related Discussions:- Tokenize a algebraic expr and sorted

Create a usercontrol called loginpasswordusercontrol, (Login User Control) ...

(Login User Control) Create a UserControl called LoginPasswordUserControl that contains a Label (loginLabel) that displays string "Login:", a TextBox (loginTextBox), where the user

Write a parser, I have a parser. it is written in Java. I need to add a has...

I have a parser. it is written in Java. I need to add a hash table to it. I am wondering about if you can do it.

Rebuilding a server environment, Project Description: We prepare and ope...

Project Description: We prepare and operate smartphone application.(Picture sharing and social networking) But there are problems in server side. It's very slow. So we

Differentiation between an applet and an application, Differentiation betwe...

Differentiation between an Applet and an Application ?

How to write exception subclasses, How to Write Exception Subclasses ? ...

How to Write Exception Subclasses ? Most exception subclasses inherit all their functionality from the superclass. Each subclass majorly serves as a marker for a various types

Explain init(), Explain init(), start(), stop(), and destroy() method? ...

Explain init(), start(), stop(), and destroy() method? The init() method is known as exactly once in an applet's life, while the applet is first loaded. It's generally used to

How do i include static files within a jsp page, Static resources should al...

Static resources should always be contained using the JSP include directive. This way, the inclusion is performed just once during the translation phase. Do note that you should al

What is an objects lock, What is an object's lock and which objects have lo...

What is an object's lock and which objects have locks? An object's lock is a mechanism that is used by multiple threads to get synchronized access to the object. A thread may i

I need to make clone of an android app, I need to Make clone of an Android ...

I need to Make clone of an Android app Project Description: Make a total duplicate of the App: Camp and RV Campgrounds Plus The only difference will be the name (as it

data integrity - security component, Data integrity helps to make sure if ...

Data integrity helps to make sure if something is communicate and not tampered with in the mean while when transmission take place. Checksums: Simply inserts the bytes withi

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd