473,750 Members | 2,225 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

formatting a birthday to reply with a day of the week

1 New Member
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 2383
JosAH
11,448 Recognized Expert MVP
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
17594
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 change the name of the "DoB" textbox to something like "Telephone" or "TelephoneBirthdate", the textbox changes to sunken, and yellow. I have tried changing the name to "DBirth", "BirthDate", "Birthday", "cusBirth", "DOBirth", etc. but, the...
51
989
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 to get moving and I need to know if what I have written so far is leading me in the right direction ~ Ok - The problem is to find out how many people need to be in a room for a 95% chance that someone in that room will match my birthday I...
8
12052
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 expressions are the same for all controls Under some undetermined circumstances, when such subform is displayed, the controls on the subform start to visibly flicker, the cursor in the subform stops blinking, and CPU utilization goes to 100%....
5
5218
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 can get the birthday for one month in particular, but i would like to be able to get birthday for a week that goes over 2 month.
11
5002
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 coding, and he coded last week.' ('coding', 'coded', 'week') expanded (for better visual): ('coding', 'coded', 'week')
1
2025
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 using microsoft access as database and asp reply ASAP
2
2344
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 peoples 40th birthdays will fall on Saturday and Sunday, I may also be out of the office on certain days. So I need to "cast a net" to catch all birthdays "approximately" one month from now, but that "approximation needs to be predictable. How...
2
2112
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 separate the numbers. By cutting and pasting the JavaScript below into a web editor and you can clearly see what is happening. Please, help. Thank You, freemld10 <html> <head> <script type="text/javascript"> function startTime() { var seconds = 0;
2
2035
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 some users birthdate is one week later.... its the same as the one in orkut..... Pls help me out thankyou
0
9000
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8838
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9577
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9339
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8260
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4713
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4887
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2225
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.