Welcome to Dream.In.Code
Become a Java Expert!

Join 149,828 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 2,540 people online right now. Registration is fast and FREE... Join Now!




creating days,month and a year Doomsday program

 
Reply to this topicStart new topic

creating days,month and a year Doomsday program

Mathiza
19 Feb, 2007 - 09:29 PM
Post #1

New D.I.C Head
*

Joined: 8 Feb, 2007
Posts: 7


My Contributions
CODE

public class Doomsday {
public static final int Monday = 0;
public static final int Tuesday = 1;
public static final int Wednesday= 2;
public static final int Thursday = 3;
public static final int Friday = 4;
public static final int Saturday = 5;
public static final int Sunday = 6;

public int Year(){}
public int Month() {} // the private memebers
public int Day() {}

public int getAnchorDay()

for (day;day==1800-1899;day++){
return Friday;
}
for (day;day==1900-1999;day++){
return Wednasday;
}
for (day;day==2000-2099;day++){
return Tuesday;
}
for (day;day==2100-2199;day++){
return Sunday;
}
publlic getDoomsdayDate()
Jan – 3 (or 4 if leap year), Feb – 28 (or 29 if leap year)
March – 0 (last day in February), April – 4, May – 9, June - 6
July – 11, August – 8, September – 5, October – 10, November - 7
December – 12
I dont know how to do this one ?
public getDoomsday()
I din't know how to do this one ?
MY MAIN  
public class Driver{

publlic static void main  (String args[]){
int f2 = Doomsday.Monday;
if (f2 == Doomsady.Sunday)
   System.out.println(f2);
   System.out.println(startDate(f2);

  }
}




Attached File(s)
Attached File  Computer_Science_practical.doc ( 27.5k ) Number of downloads: 42
User is offlineProfile CardPM
+Quote Post

NickDMax
RE: Creating Days,month And A Year Doomsday Program
20 Feb, 2007 - 03:54 PM
Post #2

2B||!2B
Group Icon

Joined: 18 Feb, 2007
Posts: 2,869



Thanked: 53 times
Dream Kudos: 550
My Contributions
Is there an actual question? I think dumping your code and assignment on us the day before it is due is a little unfair.

First of all you need to understand the Algorithm. Make sure you can do it on paper. Then you should be able to code it.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 09:30AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month