English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Programming & Design - February 2007

[Selected]: All categories Computers & Internet Programming & Design

class Date{

int day, month, year, dayOfweek;

public static int[] daysInMonth ={31,28,30,30,31,30,31,31,30,31,30,31};
public static String[] MonName = {"January", "February", "March", "April", "May", "June",

"July", "August", "September", "October", "November", "December"};
public static String[] dayName = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",

"Friday", "Saturday"};

public static Boolean isLeap(int year ){
if(year % 400 == 0)
return true;

if(year % 100 == 0 || year % 4 !=0)
return false;

return true;
}

Date(int d, int m, int y){
day = d-1;
month = m-1;
year = y;
dayOfweek=-1;
}

Date(int d, int m, int y, int w){

day = d-1;
month = m-1;
year = y;
dayOfweek =w;

}

public void next(){

if( isLeap( year ))
daysInMonth[1] = 29;

else
daysInMonth[1] = 28;

day++;

if(day == daysInMonth[month]){

day = 0;
month++;
}
if (month == 12){
month = 1;
year++;
}
dayOfweek++;
dayOfweek%=7;
}
public void print(){

System.out.println(MonName[month] + " " + (day+1) + "is a" + dayName[dayOfweek]);
}
public int compare(Date target){
if( year < target.year )
return 1;

if(year < target.year)
return -1;

if(month < target.month)
return -1;

if(month > target.month)
return -1;

if( day < target.day)
return 1;

if(day > target.day)
return -1;

return 0;
}

}

2007-02-27 03:36:58 · 2 answers · asked by Anonymous

I have made a website for my sons cub scout troop. The basic stuff was easy. I want to add something like a link to a page that has the latest cub scout news and also one with pics and video. Any ideas how I do this? I dont quite understand the whole subdomain thing I dont know if thats how I do it and if it is how do I add a page? Will I have to Pay for more pages? Please help.

2007-02-27 03:34:24 · 1 answers · asked by shelley r 1

Take a look at my website http://www.nixquadre.co.nr
is it turned out good... i got reports some people said the fonts is bigger and the background turned bad, the layout messed in some computers... is it my bad or the other computers bad? I am using Frontpage as the website builder...

2007-02-27 03:14:52 · 2 answers · asked by Anonymous

Hi, I asked this question earleir and got a very good respons, but I am still not sure if I understand it. I am creating a web site with dreamweaver and it is asking me for my FTP host and Host directory. I put my doman name in the FTP Host area but I am not sure what I should put for Host Directory. I tried leaving it blank. When I hit "test" it will not work. I am creating this site to run on godaddy.

2007-02-27 03:13:57 · 3 answers · asked by writetocorey 1

for my computer homework

2007-02-27 02:59:05 · 13 answers · asked by Anonymous

i want a file in cd. how do i do that. i have it in my computer.plz help me!

2007-02-27 02:47:16 · 4 answers · asked by helga 2

I have only English fonts in MS Word 2003. I like to add Tamil fonts with this. I think I can get different Tamil fonts from different sites. Can I add this fonts to MS Word 2003? If possible how can I do it?

2007-02-27 02:39:12 · 1 answers · asked by Raja 7

2007-02-27 02:18:37 · 2 answers · asked by SK 1

Just learned that my server has ASP 1.1 (not .net). How can I create a simple form?

2007-02-27 02:09:57 · 2 answers · asked by Mirza Hakimi 1

I want to disble the back button on Web Browser. Is there any Java/JavaScript Code to do it?

2007-02-27 01:58:32 · 3 answers · asked by Rohit A 1

2007-02-27 01:49:33 · 1 answers · asked by Krishna Mohan T 1

I am trying to put together a site similar to myspace and tribe.net. I need to be able to have mutiple logins and link people together. DO I need a web designer, a programmer, are there companies? Any ideas on where to start?

2007-02-27 01:26:11 · 3 answers · asked by ashly_fern 1

From Expert Io want the answer.

2007-02-27 01:25:35 · 4 answers · asked by Anonymous

2007-02-27 01:21:04 · 3 answers · asked by ♥--->{Shauntee}<---♥ 4

i want to make a online game lobby.

i have all the idears for the game lobby but i just need to start making it :D

do you know of free programs or tips i can get?

cheers

2007-02-27 00:55:47 · 3 answers · asked by lonewolfy92 1

I use "run as applet" and supply the necessary parameters, why does the "applet not initialised" error message in the applet launcher keeps popping up?

2007-02-27 00:51:31 · 1 answers · asked by rasiazon2000 1

2007-02-27 00:44:02 · 4 answers · asked by nadz 1

java and javascript

2007-02-27 00:42:24 · 6 answers · asked by Anonymous

Create a class named Appointment that contains instance variables startTime, endTime, dayOfWeek (valid values are Monday through Friday), and a date which consists of a valid value of month, day and year. All times should be in military time (2400 hours), therefore use appropriate data type to represent the time. Create the appropriate accessor (getter) and mutator(setter) methods. Add two constructors to the Appointment class. Next, include a default constructor (no argument passed) and a constructor to initialize an Appointment to user supplied values.

2007-02-27 00:40:58 · 3 answers · asked by Fish Guts 1

Why does my program crash when I have two JComboBoxes with action listeners attached to them, and how do I differentiate between the JComboBoxes?

2007-02-26 23:45:58 · 2 answers · asked by Anonymous

is there any way?
or is there a way that i can put a front page document in dreamweaver so that i can use flash buttons

2007-02-26 23:44:32 · 2 answers · asked by path_to_take 2

make the screen saver to work that i downloadeed off of screensavers.com

2007-02-26 23:39:39 · 4 answers · asked by hollabacgurl136 3

Can anyone explain about computer hyperlinks

2007-02-26 23:23:14 · 5 answers · asked by Anonymous

fedest.com, questions and answers