Question
In this java program we are going to work with strings. This will be a fun one I hope. a. Create a class called NameTester.
In this java program we are going to work with strings. This will be a fun one I hope.
a. Create a class called NameTester. (You will not need a class. This will have the main method in it).
b. Import Scanner
c. Create a Scanner object
d. Prompt for your first name.
e. Create a variable for your first and get the user input for your first name.
f. Prompt for your last name.
g. Create a variable for your last name and get the input for your last name.
h. Create a variable for a blank.
i. Create a variable for your full name and assign it your first and last name and a blank using the + operator.
j. Using the variable for your full name, use the substring method (use the table on page 159) as a guide) print out your name with one letter on each line.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started