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

  Design a program that asks the user to enter a series of 20

Number Analysis Program: Design a program that asks the user to enter a series of 20 numbers

  Write specifications for method which advances date by one

Write specifications for the method which advances any given date by one day. Comprise a statement of purpose, pre- and post-conditions, and description of parameters.

  Write java program to utilizes gui with five text fields

Write down the program called MaxMinAvgGUI.java which utilizes GUI with five(5)text fields which asks user to enter 5(five) decimal numbers. 1(one)number in each text field.

  How to access to elements of document object model

To limit creation of malicious code, do you believe that access to elements of document object model and some Javascript functionality be limited?

  Prepare a java simulation program

Given a hash function h, prepare a java simulation program to determine each of the subsequent quantities after 0.8*tablesize random keys have been generated. The keys should be random integers.

  Algorithm analysis with advanced data structures

Write a program to help the merchants devise a sequence of transmutations that would change silver into gold with the smallest possible total fee paid to the alchemists.

  Menu based program to maintain student records

Write a menu based program to maintain student records. Your program should take the following inputs: 1. Student first name (max. 20 characters) 2. Student last name, (max. 20 characters) 3. Student scores (float/double), eg. 85.4 Problem

  Develop java code to compute monthly rent for housing units

Develop a java code that computes monthly rent for 3 housing units namely Bungalows,Apartments and hostels. All housing units have got size,color and monthly rental rate.

  Java program that will prompt the user to input a file

Write a Java program that will prompt the user to input a file (document) in order to count the frequency of each word. This program will display the frequency of each word sorted alphabetically or by frequency (depending on the preference of the use..

  Application that generates a quiz

Create an application that generates a quiz. Prompt for the user's first and last name, college major, and confidence in test taking (high, medium, or low). The quiz should contain at least five true/false questions about horticulture. When the user ..

  You need to train for 10 weeks

You are preparing for a marathon. In order to prepare, you need to train for 10 weeks, running an increasing number of miles per week, starting at running at least 2 miles your first week up to 26 miles by week 10.

  Create a secure parts inventory catalog system

You will create a secure Parts Inventory Catalog system using Model 2 architecture. The application will require a user to have the proper access right to enter the system, and when satisfied, presents the catalog of items currently available in t..

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