Question: Write two scnr . next ( ) statements to read in the values lastName and firstName from input, respectively. Then, write a System out.println (
Write two scnrnext statements to read in the values lastName and firstName from input, respectively. Then, write a System out.println statement to output the last name a comma and the first name.
Click here for examples
Ex : If the input is Day Ani, then the output is:
Day, Ani
Ex : If the input is Pena Eve, then the output is:
Pena, Eve
Learn how our autograder works
import java.util.Scanner;
public class NameFormat
public static void mainString args
Scanner scnr new Scanner
System.in;
String lastName;
String firstName;
Y Your code goes here
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
