two code about The introduction of Java, separate it to two part
Question Description
Assignment 8.2: String Manipulation
- Complete each of the following String manipulation problems in a file called Manip.java. Your program should read in two Strings from the keyboard as shown below. It should then do the following:
- Measure the length of both words entered by the user and save the length in the related variable. Then use an
if
-statement to compare the two word lengths and print the word that is longer. - Determine whether the two words are the same (Hint: remember the equals method?)
- Concatenate the first 2 letters of the variable
first
and the last 3 letters of variablesecond
. Assign the result of the concatenation operations to variableextract
. Hint: Use charAt()- Note that you may assume the user enters words of sufficient length to complete this step
- Compare the two words using compareTo to determine which one comes first alphabeticall.
- Assignment 8.3: What’s Your Rock Star Name? (see the picture)
- Measure the length of both words entered by the user and save the length in the related variable. Then use an
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."