File \\586\E\Data\Java-doc\*.*
----------------------------------------------------------
I am trying to make a program which will compare the hours
with the actual hour of new Date() and I have difficulties with it.
Here is what I have so far:
File HelloDate3.java
import java.util.Date;
public class HelloDate3
{
public static void main (string [] args)
{
int hour = Integer.parseInt (args[0]);
if (hour >= 06:59:00:00 && hour <=12:59:00:00)
{
System.out.println (“Good Morning, Today is “ + new Date());
}
else if (hour >= 13:00:00:00 && hour <= 16:59:00:00)
{
System.out.println (“Good Afternoon, Today is “ + new Date());
}
}
}
Instead of “hour” should I use another word? “time” perhaps ?
Later, as soon at it works, I shall extend the program to include “Good Evening……..”
Your help will be very much appreciated.
Charles.
----------------------------------------------------------
I am trying to make a program which will compare the hours
with the actual hour of new Date() and I have difficulties with it.
Here is what I have so far:
File HelloDate3.java
import java.util.Date;
public class HelloDate3
{
public static void main (string [] args)
{
int hour = Integer.parseInt (args[0]);
if (hour >= 06:59:00:00 && hour <=12:59:00:00)
{
System.out.println (“Good Morning, Today is “ + new Date());
}
else if (hour >= 13:00:00:00 && hour <= 16:59:00:00)
{
System.out.println (“Good Afternoon, Today is “ + new Date());
}
}
}
Instead of “hour” should I use another word? “time” perhaps ?
Later, as soon at it works, I shall extend the program to include “Good Evening……..”
Your help will be very much appreciated.
Charles.