Ex.1 (Palindrome integer) -------------------------- Write the methods with the following headers // Return the reversal of an integer, i.e., reverse(456) returns 654 public static int reverse(int number) // Return true if number is a palindrome public static boolean isPalindrome(int number) Use the "reverse" method to implement the "isPalindrome" method. A number is a palindrome if its reversal is the same as itself. Write a test program (in the "main" method) that prompts the user to enter an integer and reports whether the integer is a palindrome and prints its reverse. Ex.2 (Display patterns) ----------------------- Write a method to display a pattern as follows: 1 2 1 3 2 1 ... n n-1 ... 3 2 1 The method header is public static void displayPattern(int n) Ex.3 (Check password) --------------------- Some websites impose certain rules for passwords. Write a method that checks whether a string is a valid password. Suppose the password rules are as follows: 1. A password must have at least eight characters. 2. A password consists of only letters and digits. 3. A password must contain at least two digits. Write a program that prompts the user to enter a password and displays "Valid Password" if the rules are followed or "Invalid Password" otherwise. Ex.4 (Game: craps) ------------------ Craps is a popular dice game played in casinos. Write a program to play a variation of the game, as follows: Roll two dice. Each die has six faces representing values 1, 2, ..., and 6, respectively. Check the sum of the two dice. If the sum is 2, 3, or 12 (called craps), you lose; if the sum is 7 or 11 (called natural), you win; if the sum is another value (i.e., 4, 5, 6, 8, 9, or 10), a point is established. Continue to roll the dice until either a 7 or the same point value is rolled. If 7 is rolled, you lose. Otherwise, you win. Your program acts as a single player. Here are some sample runs: 1: You rolled 5 + 6 = 11 You win 2: You rolled 1 + 2 = 3 You lose 3: You rolled 4 + 4 = 8 point is 8 You rolled 6 + 2 = 8 You win 4: You rolled 3 + 2 = 5 point is 5 You rolled 2 + 5 = 7 You lose Ex.5 (Game: chance of winning at craps) Revise Exercise 4 to run it 10,000 times and display the number of winning games.