Advertisement
veronikaaa86

Basic Java Simple Calculations - 04. Concatenate Data

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