Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.text.*;
- public class signs {
- public static void main(String[] args) {
- Scanner userInput = new Scanner (System.in);
- // Intro message
- System.out.println("Hello you, Lets get to know each other");
- // User input begin
- //name
- String userName;
- System.out.println("What is your name ?");
- userName = userInput.nextLine();
- //date of birth
- System.out.println(userName + " please enter you DoB (DD/MM/YYY)");
- String dateOB = userInput.next();
- SimpleDateFormat dateFormat = new SimpleDateFormat("dd/mm/yyyy");
- try {
- Date date = new SimpleDateFormat("dd/MM/yyyy").parse(dateOB);
- System.out.println(dateOB);
- } catch (ParseException e) {
- e.printStackTrace();
- return;
- }
- System.out.println("So your date of birth is " + dateOB);
- // choosing zodiac sign
- //starting the switch statement
- int convertedDate = dateOB;
- String zodiacSign;
- switch (convertedDate){
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement