Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. import java.util.*;
  2. import java.text.*;
  3.  
  4. public class signs {
  5.  
  6. public static void main(String[] args) {
  7.  
  8. Scanner userInput = new Scanner (System.in);
  9.  
  10. // Intro message
  11. System.out.println("Hello you, Lets get to know each other");
  12.  
  13. // User input begin
  14. //name
  15.  
  16. String userName;
  17.  
  18. System.out.println("What is your name ?");
  19. userName = userInput.nextLine();
  20.  
  21. //date of birth
  22.  
  23.  
  24. System.out.println(userName + " please enter you DoB (DD/MM/YYY)");
  25.  
  26. String dateOB = userInput.next();
  27. SimpleDateFormat dateFormat = new SimpleDateFormat("dd/mm/yyyy");
  28. try {
  29. Date date = new SimpleDateFormat("dd/MM/yyyy").parse(dateOB);
  30. System.out.println(dateOB);
  31. } catch (ParseException e) {
  32. e.printStackTrace();
  33. return;
  34. }
  35.  
  36. System.out.println("So your date of birth is " + dateOB);
  37.  
  38. // choosing zodiac sign
  39. //starting the switch statement
  40. int convertedDate = dateOB;
  41. String zodiacSign;
  42.  
  43. switch (convertedDate){
  44.  
  45. }
  46.  
  47.  
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement