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 scnr.next() 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 1: If the input is Day Ani, then the output is:
Day, Ani
Ex 2: 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 main(String[] args){
Scanner scnr = new Scanner(
System.in);
String lastName;
String firstName;
8
9. Y* Your code goes here *
10
11.,}
12}
1
2
3
4
5
 Write two scnr.next() statements to read in the values lastName and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!