473,395 Members | 1,905 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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!

Expand|Select|Wrap|Line Numbers
  1. package Ch2Scanner;
  2. import java.text.SimpleDateFormat;
  3. import java.util.*;
  4. public class Ch2Scanner {
  5.     public static void main(String[] args) {
  6.         Scanner scanner;
  7.         scanner = new Scanner(System.in);
  8.         SimpleDateFormat sdf;
  9.         sdf = new SimpleDateFormat("EEEE");
  10.  
  11.         String birthday;
  12.         //prompt the user for input
  13.     java.util.Date bdate = java.sql.Date.valueOf("1990-07-21");
  14.         System.out.println("Enter your birthday here:");
  15.  
  16.         birthday= scanner.next();
  17.         System.out.println("What is your birthday?" + birthday + "." );
  18.  
  19.     }
  20. }
Sep 25 '08 #1
1 2366
JosAH
11,448 Expert 8TB
What is that line #13 doing there?

kind regards,

Jos
Sep 26 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: j.t.w | last post by:
Hi All. I'm having a problem with my Date of Birth textbox. When I open the ..htm file, the "DoB" textbox is flat with a border. All of my other textboxes are sunken and are yellow. When I...
51
by: Sandra | last post by:
I was given this problem for extra credit and I am just stuck ! BTW - I am not asking for source code and I am not asking anyone to do my homework as I do want to learn .. I just need a hint or two...
8
by: Dimitri Furman | last post by:
Given: Access 2002/2003 A subform in datasheet or continuous view, placed on a tab page (this last may or may not matter) Conditional formatting applied to some controls on the subform - format...
5
by: NomoreSpam4Me | last post by:
Hi, i did a search and find the way to get the birthday without the year. My field is yyyy/mm/dd, (birthday). I also have a day field (1 to 31) and a month field. (1 to 12) My problem is: I...
11
by: Dustan | last post by:
Is there any builtin function or module with a function similar to my made-up, not-written deformat function as follows? I can't imagine it would be too easy to write, but possible... 'I am...
1
by: natvarmalpani | last post by:
i have table contact which have the userinfo and dateof birth now i have birthday.asp file on which i want to show the birthday in next 7 day ex: current systemdate and currentsystemdate +7 i...
2
by: Paul H | last post by:
I have a db that stores people and their birth dates. On any given day, I need to know who has a 40th birthday one month from now. I will only be running the query on week days but of course some...
2
by: freemld10 | last post by:
Hi guys, Can someone please help me to Format Numbers with commas. The script below have very large number without commas. To read numbers in trillions and billions are hard, without commas to...
2
by: sandeepv | last post by:
hey friends, How do we setup birthday remainders in asp.net using vb.???? this means if i have stored birthdates in the sql database....then the asp page should show the updats on the birthday if...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.