/*Matthew Schuele Calvert Hall College HS School Code: 2096 Short Cut Notation Program */ import java.util.Scanner; import java.util.Arrays; public class ACSL_2_2012_SCHUELE { public static void main(String[] args) { Scanner console = new Scanner(System.in); System.out.println("What is the bit short hand notation?"); String mInput = console.nextLine(); System.out.println("How many further inputs will there be?"); int i = console.nextInt() + 1; int y = 0; int q = 0; int t = 0; int location = 0; int Start = 0; int p = 1; int n = 1; int x = 0; int count = 0; String str = ""; String[] Tests; Tests = new String[i]; Arrays.fill(Tests, ""); String[] Inputs; Inputs = new String[i]; System.out.println("Enter the inputs."); for (x = 0; x < i; x ++) { Inputs[x] = console.nextLine(); } for (p = 1; p < i; p++) { for (t = 0; t < mInput.length(); t++) { if ((mInput.charAt(t) >= '0') && (mInput.charAt(t) <= '1')) { Tests[p] += Inputs[p].charAt(t); }} } for (y = 0; y < mInput.length(); y++) { if ((mInput.charAt(y) >= '0') && (mInput.charAt(y) <= '1')) { str += mInput.charAt(y); }} for (n = 1; n < i; n++) { if (str.equals(Tests[n])) { count++; System.out.println(Inputs[n] + " is a valid input."); }} if (count == 0) { System.out.println("No valid inputs."); } } }