Advertisement
myrdok123

06. Concatenate Data

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