Question: Problem 2 * Write and run a java program that prompts the user to enter the 8 digit alpha-numeric code for a CSET course offered
Problem 2 * Write and run a java program that prompts the user to enter the 8 digit alpha-numeric code for a CSET course offered at the University of Toledo, extracts the first 4 characters, and the last 4 characters as separate strings, and prints the complete course name. A sample run should look like this: Enter an 8-digit alphanumeric course name: CSET1200 You entered: CSET1200 The first 4 characters are: CSET The last 4 characters are: 1200
I already have most of the code already wrote. I'm stuck on a few parts if you could help me and explain why these are errors that would be great.

package alpha.numeric.code; import java . util . Scanner; public class AlphaNumericcode public static void ma in (String[] args) { Scanner input -new Scanner (System.in): I/ Creating the Scanner object int WordLength; String first = " ", last = " ", word " "; System.out.printin ("Enter an 8 digit alpha numeric code "); String su -scan.next) WordLengthsu.length first su . substring (0, Ma th . min (su.length ( ), 4)); = System.out.println ("The first 4 characters are "+ first) last = su.substring (4, Math.m1n(su.length ( ), wordLength)); System.out.println ("The last 4 characters are: "+ last) System.out.println ("The complete coursename is: " first last): alpha.numeric.code.AlphaNumericCode > main> su >
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
