I am building the framework for a fraction calculator in my AP CS class. I have figured everything out besides how to get it telling you that your input is invalid.
The kind of input that is acceptable is 2_2/3 + 4/5 or 4/6 - 2/5 but I want it to give an error if letters or more than two fractions are entered. Here is what I have, but it only seems to work with letters and not with numbers. I got 13 from the length of the maximum valid fractions I want. Ex. 2_2/4 + 3_4/5
if (inputLength >= 13) {
System.out.println("Your Input is too long");
}