formatting a birthday to reply with a day of the week

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stilldancin12
    New Member
    • Sep 2008
    • 1

    formatting a birthday to reply with a day of the week

    Ok so i have to write an application that asks for the users birthday and replies with they day of the week in which he or she is born on, using the java program. This is what I have so far.It gives me the actual birthday, but not the day of the week. I feel like i am just missing one simple line of text but I can't figure out what it is. Any help would be appriciated!

    Code:
    package Ch2Scanner;
    import java.text.SimpleDateFormat;
    import java.util.*;
    public class Ch2Scanner {
    	public static void main(String[] args) {
    		Scanner scanner;
    		scanner = new Scanner(System.in);
    		SimpleDateFormat sdf;
    		sdf = new SimpleDateFormat("EEEE");
    	
    		String birthday;
    		//prompt the user for input
    	java.util.Date bdate = java.sql.Date.valueOf("1990-07-21");
    		System.out.println("Enter your birthday here:");
    		
    		birthday= scanner.next();
    		System.out.println("What is your birthday?" + birthday + "." );
    		
    	}
    }
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    What is that line #13 doing there?

    kind regards,

    Jos

    Comment

    Working...