Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. /**
  2. * DIRECTIONS TO STRINGPROGPRACTICE 2
  3. *
  4. * declare & initialize & print strings
  5. * output: skips lines between each one
  6. * 1. first name
  7. * 2. middle name
  8. * 3. last name
  9. * 4. full name by combining first middle last name,
  10. * 5 counting full name using .length
  11. * 6. part name taken from full name using substring
  12. * 7. print first name and then the next line take away a character one
  13. * a time for each line- using counted loop
  14. * 8. declare & initialize int variable
  15. * 9. begin with 1 and print up to the number 5 on the same line.
  16. * 10. declare, initialize, print first middle last name on
  17. * separate lines in uppercase using .toUpperCase
  18. * 11. using if else and using equals are firstName and firstNameCaps
  19. * the same print if they are the same or different.
  20. * 12. using if else and using equalsIgnoreCase- are middleName
  21. * and middleNameCaps the same. print if they are the same
  22. * or different
  23. * 13. using if else and using equals- are lastName and lastNameCaps
  24. * the same. print if they are the same or different
  25. OUTPUT WILL LOOK LIKE:
  26. My first name is Samantha
  27.  
  28. My middle name is Grace
  29.  
  30. My last name is Seibert
  31. //purple
  32. My full name is Samantha Grace Seibert
  33.  
  34. My name is 22 characters long
  35.  
  36. partName is Samantha Grace
  37.  
  38. Samantha Grace Seibert
  39. amantha Grace Seibert
  40. mantha Grace Seibert
  41. antha Grace Seibert
  42. ntha Grace Seibert
  43. tha Grace Seibert
  44. ha Grace Seibert
  45. a Grace Seibert
  46. Grace Seibert
  47. Grace Seibert
  48. race Seibert
  49. ace Seibert
  50. ce Seibert
  51. e Seibert
  52. Seibert
  53. Seibert
  54. eibert
  55. ibert
  56. bert
  57. ert
  58. rt
  59. t
  60.  
  61. 1 2 3 4 5
  62.  
  63. SAMANTHA
  64.  
  65. GRACE
  66.  
  67. SEIBERT
  68.  
  69. The first names are not the same.
  70.  
  71. The middle names are the same.
  72.  
  73. The last names are the same.
  74.  
  75. *
  76. *
  77. *
  78. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement