Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. /**
  2. * Prints each letter of a given string (one per line).
  3. * @param myName A string to analyze
  4. */
  5. public static void printEachLetter(String myName)
  6. {
  7. for (int i=0; i < myName.length; i++)
  8. {
  9. system.out.pritnln(myName.charAt(i));
  10. }
  11. }
  12.  
  13.  
  14. /**
  15. * Determines if the given letter is a vowel.
  16. * @param a The letter to analyze
  17. * @return True if the letter is a vowel, false otherwise. Y will not be considered a vowel.
  18. */
  19. private boolean isVowel(char ltr)
  20. {
  21. if (ltr == 'a' || ltr == 'e' || ltr == 'i' || ltr == 'o' || ltr == 'u')
  22. return true;
  23. else
  24. return false;
  25. }
  26.  
  27. /**
  28. * Prints only the vowels in a given string (one per line).
  29. * @param myName The string to analyze
  30. */
  31. public void printVowels(String myName)
  32. {
  33. // your code goes here
  34. }
  35.  
  36. /**
  37. * Returns a backwards copy of the original string.
  38. * @param original The original string to analyze
  39. * @return A backwards copy of the original string
  40. */
  41. public String backwardsString (String original)
  42. {
  43. // replace the body of this method
  44. return "";
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement