Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Program main untuk menjalankan infix ke postfix
- *
- * @author Cahyadi Surya Nugraha
- * @version 1.0
- * @since Mei 05th 2021
- * */
- package ETSSoal2.com;
- import java.util.Scanner;
- public class Main
- {
- public static void main(String[] args)
- {
- Scanner userInput = new Scanner(System.in);
- String input, output, choose;
- do
- {
- System.out.println("================================================================");
- System.out.print("Enter infix expression : ");
- input = userInput.nextLine();
- output = ExpressionConverter.infixToPostfix(input);
- System.out.println("Infix Expression : " + input);
- System.out.println("Postfix Expression : " + output);
- System.out.print("Apakah masih ingin melanjutkan program ? (Yes / No) : ");
- choose = userInput.nextLine();
- System.out.println("================================================================");
- System.out.println();
- } while(choose.equals("Yes") || choose.equals("yes"));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment