Question: Given string userName on one line and string lastName on a second line, append a forward slash to userName. Then, append lastName to userName. Ex:
Given string userName on one line and string lastName on a second line, append a forward slash to userName. Then, append lastName to userName. Ex: If the input is: Wilma Hill then the output is: Wilma/Hill 1 import java. util. Scanner; public class ConcatenateString { public static void main(String args) { Scanner sonr = new Scanner (System. in) ; 6 String userName; 7 String lastName; 8 userName = scnr . nextLine(); 10 lastName = scnr . nextLine(); 11 12 /* Your code goes here */ 13 14 System. out . printIn (userName ) ; 15 16 }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
