Advertisement
veronikaaa86

06. Concatenate Data

Jul 2nd, 2022
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class P06ConcatenateData {
  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.println("You are " + firstName + " " + lastName + ", a " + age + "-years old person from " + town + ".");
  13.  
  14. System.out.printf("You are %s %s, a %d-years old person from %s.", firstName, lastName, age, town);
  15. }
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement