galinyotsev123

ProgBasicsJavaBook2.1SimpleCalculations04ConcatenateData

Jan 25th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  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. System.out.printf("You are %s %s, a %d-years old person from %s.",
  12. firstName, lastName, age, town);
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment