@@ -0,0 +1,1537 @@
+import java.util.Scanner;%0A%0A/**%0A * This program determines if two entered strings are subsets of each other.%0A **/%0Apublic class Subset %7B%0A    public static boolean contains(String a, String b) %7B%0A        int count = 0;%0A        %0A        for (int i = 0; i %3C a.length(); i++) %7B%0A            for (int j = 0; j %3C b.length(); j++) %7B%0A                if (a.charAt(i) == b.charAt(j)) %7B%0A                    count++;%0A                %7D%0A            %7D%0A        %7D%0A%0A        if (a.length() == count) %7B%0A            return true;%0A        %7D else %7B%0A            return false;   %0A        %7D%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        System.out.println(%22Checking for subsets - distinct letters only%22);%0A        Scanner scanner = new Scanner(System.in);%0A%0A        System.out.println(%22Input first word%22);%0A        // This is called method chaining. Since scanner.nextLine() returns a String,%0A        // we can just directly chain toLowercase() to it.%0A        String a = scanner.nextLine().toLowerCase();%0A        System.out.println(%22Input second word%22);%0A        String b = scanner.nextLine().toLowerCase();%0A%0A        if (contains(a, b) && contains(b, a)) %7B%0A            System.out.println(%22Both are subsets of each other%22);%0A        %7D else if (contains(a, b) && !contains(b, a)) %7B%0A            System.out.println(a + %22 is a subset of %22 + b);%0A        %7D else if (contains(b, a) && !contains(a, b)) %7B%0A            System.out.println(b + %22 is a subset of %22 + a);%0A        %7D else %7B%0A            System.out.println(%22Neither is a subset of the other%22);%0A        %7D%0A    %7D%0A%7D%0A

Add problem 2 to unit 3