Advertisement
akosiraff

LastNameFirstNameWeek3 JAVA

Nov 11th, 2013
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/lastnamefirstnameweek3-java/
  3. Create & name a file with the following format: LastNameFirstNameWeek3.java.
  4. Example:The instructor would create a file with the following name: DeweyKenWeek3.java
  5. Proper coding conventions required the first letter of the class start with a capital letter and the first letter of each additional word start with a capital letter.
  6. Only submit the.java file needed to make your program run.
  7. 5%
  8. LastNameFirstNameWeek3.java
  9. Use the Scanner class to accept input from the user.
  10. Prompt the user for their first name, last name, and age each individually.
  11. Use string concatenation to obtain the user’s full name.
  12. Use equals() and If their first and last name are the same print: “Hello First Last, your first and last name are the same”
  13. If your first and last name are different, print: “Hello First Last, your first and last name are different”
  14. Print the length of their first name and of their full name.
  15. Use the charAt() method of the String class to find the user’s initials. Print these, followed by their ASCII value, in tabular format (see example)
  16. Print out the name per example below.
  17. Using an increment operator, increase the age by one output per example below. Do not create a new variable
  18. Using compound assignment operators, increase the age by 4 more and output the new age. Do not create a new variable.
  19. 90%
  20. Upload your document to the Dropbox.
  21. NOTE: Complete your activity and submit it to the Dropbox.
  22. If needed, click on the Help button above for more information on Course Tools/Using the Dropbox.
  23. 5%
  24. Total
  25. 100%
  26. Example 1
  27. Please enter your first name: Ken
  28. Please enter your last name: Ken
  29. Please enter your age in years: 48
  30. Hello Ken Ken, your first and last name are the same
  31. The length of your first name is: 3
  32. The length of your full name is: 6
  33. Inits ASCII Value
  34. K 75
  35. K 75
  36. You are now 48 years old.
  37. In one year you will be 49.
  38. In five years you will be 53.
  39. Example 2
  40. Please enter your first name: Ken
  41. Please enter your last name: Dewey
  42. Please enter your age in years: 48
  43. Hello Ken Dewey, your first and last name are different
  44. The length of your first name is: 3
  45. The length of your full name is: 8
  46. Inits ASCII Value
  47. K 75
  48. D 68
  49. You are now 48 years old.
  50. In one year you will be 49.
  51. In five years you will be 53.
  52.  
  53. Download: http://solutionzip.com/downloads/lastnamefirstnameweek3-java/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement