PART 2: Variables, Constants, and Arithmetic The following are sample runs of the program to help you write your code and format your output: Sample Output 1: Please enter your first name: Alfred Please enter your last name: Johnson W/ Hello Alfred Johnson //\ The length of your full name is 13 characters Your standard username is: AJohnson Your initials are: A.J. If we switch the first and last characters of your first name, we get: dlfrea ----jGRASP: operation complete. Sample Output 2: Please enter your first name: Jennifer Please enter your last name: Todd W/ Hello Jennifer Todd // The length of your full name is 12 characters Your standard usexname is: JTodd Your initials are: J.T. If we switch the first and last characters of your first name, we get: rennifeJ ----jGRASP: operation complete. Instructions for Part 2: 1. Go to the following URL to complete the project: Project 1 B 2. If using and IDE (JGrasp or Eclipse), create a new class file named StringFun.java (optional) 3. You will be filling in code everywhere you see the ellipses (...) in the code. Please follow the instructions and use the Sample Outputs to guide you. 4. Write the Class comment and gauthor and Qvezsion tags 5. Create a variable to store the input for the first name and use a Scanner method to read the value from the Console. 6. Create a variable to store the input for the last name and use a Scanner method to read the value from the Console. 7. Output the welcome message with concatenated full name and the escape strings (see sample output). Use your variables from Steps 5 & 6. 8. Output the standard username of the user using methods of the String class (to get first initial) and concatenation. 9. Output the initials of the user using methods of the String class and concatenation. 10. Declare an integer variable to store the last index of the first name. Use a method of the String class to assign this index to the variable. 11. Declare a String variable to store the switched first and last letters of the first name. 12. Use method(s) of the String class (substring, charAt, length) to assign the switched name to the variable. See 2.5.6 and substring video in iCollege additional videos 13. Output the switched name (see sample output). 14. Submit your code and check the tests and correct any error messages or output formatting issues.
PART 2: Variables, Constants, and Arithmetic The following are sample runs of the program to help you write your code and format your output: Sample Output 1: Please enter your first name: Alfred Please enter your last name: Johnson W/ Hello Alfred Johnson //\ The length of your full name is 13 characters Your standard username is: AJohnson Your initials are: A.J. If we switch the first and last characters of your first name, we get: dlfrea ----jGRASP: operation complete. Sample Output 2: Please enter your first name: Jennifer Please enter your last name: Todd W/ Hello Jennifer Todd // The length of your full name is 12 characters Your standard usexname is: JTodd Your initials are: J.T. If we switch the first and last characters of your first name, we get: rennifeJ ----jGRASP: operation complete. Instructions for Part 2: 1. Go to the following URL to complete the project: Project 1 B 2. If using and IDE (JGrasp or Eclipse), create a new class file named StringFun.java (optional) 3. You will be filling in code everywhere you see the ellipses (...) in the code. Please follow the instructions and use the Sample Outputs to guide you. 4. Write the Class comment and gauthor and Qvezsion tags 5. Create a variable to store the input for the first name and use a Scanner method to read the value from the Console. 6. Create a variable to store the input for the last name and use a Scanner method to read the value from the Console. 7. Output the welcome message with concatenated full name and the escape strings (see sample output). Use your variables from Steps 5 & 6. 8. Output the standard username of the user using methods of the String class (to get first initial) and concatenation. 9. Output the initials of the user using methods of the String class and concatenation. 10. Declare an integer variable to store the last index of the first name. Use a method of the String class to assign this index to the variable. 11. Declare a String variable to store the switched first and last letters of the first name. 12. Use method(s) of the String class (substring, charAt, length) to assign the switched name to the variable. See 2.5.6 and substring video in iCollege additional videos 13. Output the switched name (see sample output). 14. Submit your code and check the tests and correct any error messages or output formatting issues.
Chapter2: Using Data
Section: Chapter Questions
Problem 14RQ
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT