Question: Intro to JAVA Please see below: Write a program that reads in the first and last name of a person and prints the last name,
Intro to JAVA Please see below:
Write a program that reads in the first and last name of a person and prints the last name, followed by a comma, a space, and the first name. For example:
Please enter your first and last name: Harry Morgan Morgan, Harry
CODE BELOW:
import java.util.Scanner;
public class Name { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Please enter your first and last name: "); // Read in the first and last name
// Print the last name, a comma, a space, and the first name
System.out.println(......); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
