Skip to content

Commit 28170da

Browse files
author
Suresh Shrestha
committed
#1 Simple Full Name Salutation program.
1 parent 0ba128c commit 28170da

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.lftechnology.phpjava.assignmentone;
2+
3+
import java.util.Scanner;
4+
5+
public class FullNameSalutation {
6+
7+
public static void main(String[] args) {
8+
// TODO Auto-genetorated method stub
9+
10+
System.out.println("Assignment One: Full Name Salutation.");
11+
12+
Scanner reader = new Scanner(System.in);
13+
14+
String firstName;
15+
System.out.println("Enter your first name: ");
16+
firstName = reader.next();
17+
18+
String lastName;
19+
System.out.println("Enter your family name: ");
20+
lastName = reader.next();
21+
22+
String salutation;
23+
System.out.println("What salutation should be used?");
24+
salutation = reader.next();
25+
26+
String fullName;
27+
fullName = salutation + " " +firstName + " " + lastName;
28+
29+
System.out.println("Your full name is: " + fullName);
30+
31+
}
32+
33+
}

0 commit comments

Comments
 (0)