Reset author name to chosen name ✨
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package lab10_chloefontenot;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author chloe
|
||||
*/
|
||||
public class ReadWriteName2 {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// Create scanner
|
||||
Scanner input = new Scanner(System.in);
|
||||
|
||||
// Setup variables
|
||||
String firstName, lastName;
|
||||
|
||||
// Prompt for input
|
||||
System.out.println("Please enter your first name, followed by your last name: ");
|
||||
firstName = input.next();
|
||||
lastName = input.next();
|
||||
|
||||
//Print output
|
||||
System.out.println("Hello, " + firstName + ", " + lastName + ".");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user