Advertisement
SotirovG

ConcatenateData_06

Oct 28th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. package FirstStepsInCodingLab;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class ConcatenateData_06 {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         // Напишете програма, която прочита от конзолата име, фамилия, възраст и град
  9.         //"You are <firstName> <lastName>, a <age>-years old person from <town>."
  10.  
  11.         String firstName = scanner.nextLine();
  12.         String lastName = scanner.nextLine();
  13.         int age = Integer.parseInt(scanner.nextLine());
  14.         String town = scanner.nextLine();
  15.  
  16.         System.out.printf("You are %s %s, a %d-years old person from %s.",firstName,lastName,age,town);
  17.  
  18.  
  19.     }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement