Advertisement
Samuel_Berkat_Hulu

Appp

Apr 27th, 2021
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1.  
  2. /**
  3.  * Write a description of class App here.
  4.  *
  5.  * @author Samuel Berkat Hulu
  6.  * @version 5.0 21-April-2021
  7.  */
  8.  
  9. import java.io.*;
  10. public class App
  11. {
  12.      public static void main(String[] args) throws IOException
  13.     {
  14.         String input, output;
  15.         while(true)
  16.         {
  17.             System.out.print("Enter infix: ");
  18.             System.out.flush();
  19.             input = getString();
  20.             if( input.equals("") )
  21.                 break;
  22.            
  23.             infixtopostfix theTrans = new infixtopostfix(input);
  24.             output = theTrans.doTrans();
  25.             System.out.println("Postfix is " + output + '\n');
  26.         }
  27.     }
  28.    
  29.     public static String getString() throws IOException
  30.     {
  31.         InputStreamReader isr = new InputStreamReader(System.in);
  32.         BufferedReader br = new BufferedReader(isr);
  33.         String s = br.readLine();
  34.         return s;
  35.     }
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement