Pls read the comments in the code. Different scenarios ...it would be great if any one could tell me other solutions to achieve the same. Pls read the comments in the code. Different scenarios ...it would be great if any one could tell me other solutions to achieve the same.
package parsexml.matcher;
import java.util.Scanner;
public class BackUp {
// 1. input : if the quantity a < 90 and b > 90 then click on < ok >
// 1. output :if the quantity a less than 90 and b greater than 90 then click on < ok >
// 2.if the quantity a > 90 or a < 90 then click on < submit>
// 2. output : if the quantity a greater than 90 or a less than 90 then click on < submit>
// etc .from 3- 9 , i get the expected output
// 3. if the quantity a> b then click on <submit>
// 4. if the quantity a > b or a < c then click on < submit>
// 5. if the quantity a < 90 then click on <submit>
// 6. if the quantity a > 90 then click on <submit>
// 7. if the quantity a < b then click on <submit>
// 8. if the quantity a > b then click on < submit >
//9. validate a < 100 in the expression and press < click >
// 10. if amount < fd then if price > 80 click on < submit >
public static void main(String[] arg) {
String inputText;
String outputText = "";
String greater = "";
Scanner s = new Scanner(System.in);
inputText = s.nextLine();
if (inputText.contains("<")) {
outputText = inputText.replaceAll("(\\w+)\\s*<\\s*(\\w++(?!\\s*>))", "$1 less than $2");
// System.out.print("\n"+outputText);
}
if (outputText.contains(">")) {
greater = outputText.replaceAll("(\\w+)\\s*>\\s*(\\w++(?!\\s*>))", "$1 greater than $2");
System.out.print("\n" + greater);
}
if (outputText.contains(">"))
return;
else if (inputText.contains(">")) {
String greater2;
greater2 = inputText.replaceAll("(\\w+)\\s*>\\s*(\\w++(?!\\s*>))", "$1 greater than $2");
System.out.print("\n" + greater2);
} else
return;
}
}