Sample methods to write:Sample methods to write:1. Write a value-returning method, isVowel, that returns the value “true” if a given character is a vowel, and otherwise returns “false”. public static boolean isVowel ( char letter) { char x; String str = String.valueOf(letter);// change the letter to uppercase x = Character.toUpperCase(letter); switch (x) { case 'A': case 'E': case 'I': case 'O': case 'U': return true; default: return false; }} // end isVowelAlternately in the method you can use an if statement instead of the case public static boolean isVowel ( char letter) { char x; String str = String.valueOf(letter);// change the letter to uppercase x = Character.toUpperCase(letter);if ((letter == ‘A’) || ( letter == ‘E’) || (letter == ‘I’) || (letter == ‘O’) || (letter == ‘U’))return true;else return false;} // end isVowel2. Write a program that prompts the user to input a sequence of characters (as a string) and outputs the number of vowels. (Hint: Your program should usethe method in the previous problem, use a loop, and methods from class STring) 3. Consider the following program outline:public class Mystery { public static void main(String[] args) {int num;double dec;// some statements go here}// end of mainpublic static int one(int x, int y) {}// end of onepublic static double two( int x, double a) {int first;double z, } // end of two}// end of class mysterya. Write the definition of method one so that it returns the sum of x and y if x is greater than y; other wise it should return x minus 2 times y.b. write the definition of method two as follows:i. read a number and store it in z.ii. update the value of z by adding the value of a to itiii. assign the variable first the value returned by method one withthe parameters 6 & 8iv. update the value of first by adding the value of x to its previousvaluev. if the value of z is more than twice the value of first, return z otherwise return 2 times first minus z.4. Write a method, “reverseDigit” that takes an integer as a parameter, and returns the number with its digits reversed. For example the value of “reverseDigit(123) is 321. Also, write a main program to test your
View Full Document