Question: Please write in JAVA your assignment requires that you get the last character in each name. The last character is located at the index number
Please write in JAVA
your assignment requires that you get the last character in each name. The last character is located at the index number that corresponds to the length of the string minus 1.
1. Ask the user (include appropriate dialog) to enter their:
first name middle name last name
save each of the above as a String variable as follows:
firstName middleName lastName
2. Print to the screen the number of characters in each of the names (first, middle and last)
3. Print to the screen total number of characters in all three names. Include appropriate dialog in your output.
4. Print to the screen the last letter in each of the three names entered in all capitals with no space or lines between them. For example MCC.
5. Print to the screen the total of the ASCII values of the letters printed in #4 above. For example the letters YCE would sum to 225 (89 + 67 + 69). Remember that the ASCII values are as follows and to find the ASCII value of a single character by casting the character to an int by using (int).
| A | 65 | N | 78 |
| B | 66 | O | 79 |
| C | 67 | P | 80 |
| D | 68 | Q | 81 |
| E | 69 | R | 82 |
| F | 70 | S | 83 |
| G | 71 | T | 84 |
| H | 72 | U | 85 |
| I | 73 | V | 86 |
| J | 74 | W | 87 |
| K | 75 | X | 88 |
| L | 76 | Y | 89 |
| M | 77 | Z | 90 |
Here is a sample input/output for this assignment:
Enter your first name: mickey
Enter your middle name: magic
Enter your last name: mouse
Length of First Name: 6 Length of Middle Name: 5 Length of Last Name: 5
Initials: YCE
Total ASCII Values of Initials: 225
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
