Rewrite this code in order to ask the user for input

Assignment Help JAVA Programming
Reference no: EM13166550

This code is running fine .. i want to rewrite this code in order to ask the user for input and then coverth it from infex to postfix ,, so i want to put a Scanner and this ask the user for input .. how to do it ?

 

public static void main(String[] args)

throws IOException {

String input = "((3*4)+6)/2";

String output;

infix2postfix theTrans = new infix2postfix(input);

output = theTrans.doTrans();

System.out.println("Postfix is " + output + '\n');

}

This code is running fine .. i want to rewrite this code in order to ask the user for input and then coverth it from infex to postfix ,, so i want to put a Scanner and this ask the user for input .. how to do it ?

 

public static void main(String[] args)

throws IOException {

String input = "((3*4)+6)/2";

String output;

infix2postfix theTrans = new infix2postfix(input);

output = theTrans.doTrans();

System.out.println("Postfix is " + output + '\n');

}

Reference no: EM13166550

Questions Cloud

Keep track of the size of the array : Keep track of the size of the array so that you cannot exceed the array boundaries. The implementation details (i.e. the private members)of your class are up to you, but the class should have the following public interface
The user is assumed to enter the list in sorted order : Make sure you FULLY test your program! Make sure to run your program multiple times, inputting combinations of values that will test all possible conditions for your IF statements and loops. Also be sure to test border-line cases.
Interaction between the customer and the machine : In Python:Simulate a cash register or ATM including the interaction between the customer and the machine (i.e. assume that you are automating the responses)
Effective parenting tricks : If you are a parent, describe one of your favorite and most effective parenting “tricks” and how it achieves its goal. If you are not a parent, describe how you might have seen another parent handle a troublesome child.
Rewrite this code in order to ask the user for input : rewrite this code in order to ask the user for input and then coverth it from infex to postfix ,, so i want to put a Scanner and this ask the user for input .. how to do it ?
Important in the environment of our organizations : Wellness programs are so important in the environment of our organizations, however, the problem is that there is no real cost savings up front and the savings are usually soft dollars - in other words, dollars that are not being spent but that are a..
Nuclear weapons and nuclear energy : Based on current events, describe the state of nuclear energy and its peaceful uses in at least one country.  In your opinion, which is the greater threat – the use of nuclear weapons in war or the peaceful use of nuclear energy? Explain your answe..
Deceptive communicator : Your response was: One possible way to spot such deceptive communicator is to build the talk around them but not only about them. We can say out our message in between the lines when we are talking only about them and just making few references to wh..
Tradi-tional art critics : For what reason would Turner’s The Slave Ship have been criticized by tradi- tional art critics?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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