Advertisement
mloma

Untitled

Jun 29th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1.  
  2. import java.util.Scanner;
  3.  
  4.  
  5. public class Targil {
  6.  
  7.  
  8.  
  9. public static void main(String[] args) {
  10. // TODO Auto-generated method stub
  11. boolean gen;
  12.  
  13. final int nowYear=2016;
  14. Scanner s= new Scanner(System.in);
  15. System.out.println("Enter you'r barthDay year (yyyy):");
  16. int barthY= nowYear- s.nextInt();
  17. System.out.println("Enter you'r Id number:");
  18. int id= s.nextInt();
  19. System.out.println("Enter you'r hight (in metres):");
  20. double hight=s.nextDouble();
  21. System.out.println("Enter M\\F (one char Capitle):");
  22. char gender=s.next().charAt(0);
  23.  
  24. System.out.println("\nYou'r age is: "+barthY+"\nYou'r Id number is: "
  25. +id+"\nYou'r hight is: "+hight+"\nYou'r gender is: "+gender);
  26.  
  27. if(gender=='M')
  28. {
  29. gen=true;
  30. }else{
  31. gen=false;
  32. }
  33.  
  34.  
  35.  
  36. }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement