@@ -0,0 +1,720 @@
+/**%0A * Unary coding%0A * %0A * @author Atom%0A *%0A */%0Apublic class UnaryCoding %7B%0A%0A%09public static final char UNARY_SYMBOL = '1';%0A%09public static final char END_SYMBOL = '0';%0A%09%0A%09/**%0A%09 * Represents a natural number n by repeating n times an arbitrary symbol followed by another arbitrary symbol.%0A%09 * %0A%09 * @param x The number to be encoded%0A%09 * @return A string with the coded number%0A%09 */%0A%09public static String unaryCoding(final int x) %7B%0A%09%09StringBuilder sb = new StringBuilder();%0A%09%09for (int i = 0; i %3C x; i++) %7B%0A%09%09%09sb.append(UNARY_SYMBOL);%0A%09%09%7D%0A%09%09sb.append(END_SYMBOL);%0A%09%09return sb.toString();%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09for (int i = 0; i %3C 15; i ++) %7B%0A%09%09%09System.out.println(i + %22: %22 + unaryCoding(i));%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

Create UnaryCoding.java