APCS Unit 2
Classes, Instances, Objects
Specification
Create a new class in your Unit 2 project called ClassesInstancesObects.
Write each of the methods listed below.
You may only use what we've directly covered in class. (no boolean expressions, loops, or conditionals)
The solutions all require study of the documentation for Integer, Dou
ble, and String.

public static String binMaxInt()
// return the binary representation of the maximum int value

public static String binDiffMax(Integer i)
// return the binary representation of the difference between i and the 
// maximum integer value

public static String mutant(String a, String b)
// return a string containing the front half of a and the back half of b
// "muffin" "cupcake" -> "mufcake"
// "lobster" "fish" -> "lobsh"

public static String triMutant(String a, String b, String c)
// return a string containing the first third of a, the middle third of b
// and the final third of c
//"yesterday", "today", "tomorrow" -> "yesodrow"
//"dog", "cat", "bird" -> "dard"
//"pancakes", "waffles", "omelettes" -> "pafftes"


public static String swapEnds(String a)
// return the string a with the first and last letters swapped
// "pickles" -> "sicklep"
// "bird" -> "dirb"
// "regrets" -> "segretr"

public static int indexOf2nd(String haystack, String needle)
// return the index of the second occurrence of needle in haystack. 
// if there is no second occurrence, return -1
// "bananas", "a" -> 3
// "bananas", "n" -> 4
// "bananas", "s" -> -1
// "bananas", "t" -> -1 

public static int indexOf2ndLast(String haystack, String needle)
// return the index of the second to last occurrence of needle in haystack.
// "bananas", "a" -> 3
// "bananas", "n" -> 2
// "bananas", "s" -> -1
// "bananas", "t" -> -1 

public static boolean reduplicates(String word)
// return true if the word reduplicates. "mama", "cancan", "papa", and "mumu" are examples of words that reduplicate.

public static boolean binContains(Integer i, String p)
// return true if the binary representation of i contains the bit pattern p where p contains only 1s and 0s.
// binContains(65, "001") -> true
// binContains(66, "011") -> false
// binContains(66, "0010") -> true

public static boolean isPalindrome(Integer i)
// return true if the binary representation of i is a palindrome.
// A palindrome is a sequence of characters that reads the same forwards 
// and backwards.
// 1001001 is a palindrome
// 11111 is a palindrome
// 100010 is not a palindrome
// 101010 is not a palindrome

public static boolean isAnagram(Integer a, Integer b)
// return true if a and b are anagrams of each other.
// boolean numbers are anagrams if (accounting only for the most
// significant digit and lower) they contain the same digits in
// a different order. You can assume both a and b are positive.
// 1011 and 1110 -> true
// 111000 and 101010 -> true
// 1100111 and 101111 -> true
// 110 and 1100011 -> false
// 10011101 and 110011 -> false

public static boolean cubeContainsSelf(Integer i)
// return true if the string representation of i^3 contains i.
//(0, 0), (1, 1), (2, 8), (3, 27), (4, 64), (5, 125), (6, 216), (7, 343), //(8, 512), (9, 729), (10, 1000), (11, 1331), (12, 1728), (13, 2197), 
//(14, 2744), (15, 3375), (16, 4096), (17, 4913), (18, 5832), (19, 6859),
//(20, 8000), (21, 9261), (22, 10648), (23, 12167), (24, 13824)

public static Double maxValue(Double a, Double b, Double c, Double d)
// return the largest  value from a, b, c, and d. NO BOOLEAN EXPRESSIONS OR CONDITIONALS!!

public static Integer middleValue(Integer a, Integer b, Integer c)
// return the middle value. NO BOOLEAN EXPRESSIONS OR CONDITIONALS!

//Bonus Round!!!!
public static Integer middleValue(Integer a, Integer b, Integer c, Integer d, Integer e)
// return the middle value. NO BOOLEAN EXPRESSIONS OR CONDITIONALS!!!