Advertisement
desislava_topuzakova

04. Concatenate Data

Apr 22nd, 2018
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1.  
  2.  
  3. public class GreetingByName {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         String name = scanner.nextLine();
  8.         String lastName = scanner.nextLine();
  9.         int age = Integer.parseInt(scanner.nextLine());
  10.         String town = scanner.nextLine();
  11.  
  12.  
  13.         System.out.printf("You are %s %s, a %d-years old person from %s.", name, lastName, age, town);
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement