Ver Mensaje Individual
  #4 (permalink)  
Antiguo 03/01/2005, 16:47
Avatar de aetrejo
aetrejo
 
Fecha de Ingreso: septiembre-2004
Ubicación: Guatemala
Mensajes: 131
Antigüedad: 22 años
Puntos: 0
Cita:
Iniciado por crucifijo
Hola amigo otra vez yo dando guerra mira ya le modifique la linea pero auna asi me sigue mandando el error que puedo hacer

Gracias por contestar mi pregunta
Bueno primero que soy amiga no amigo...

y luego el código correcto....

Código PHP:
import java.util.Calendar;
import java.util.GregorianCalendar;

class 
ClockTalk {
    public static 
void main(String[] arguments) {

        
GregorianCalendar now = new GregorianCalendar();
        
int hour = now.get(Calendar.HOUR_OF_DAY);
        
int minute = now.get(Calendar.MINUTE);
        
int month = now.get(Calendar.MONTH) + 1;
        
int day = now.get(Calendar.DAY_OF_MONTH);
        
int year = now.get(Calendar.YEAR);

        if (
hour < 12) {
            
System.out.println("Good morning.\n");
        } else if (
hour < 17) {
            
System.out.println("Good afternoon.\n");
        } else {
            
System.out.println("Good evening.\n");
        }

        
System.out.print("It's");
        if (
minute != 0) {
            
System.out.print(" " + minute + " ");
        }
        
System.out.print((minute != 1) ? "minutes" : "minute");
        
System.out.print(" past ");

        
System.out.print(" ");

        
System.out.print((hour > 12) ? (hour - 12) : hour);

        
System.out.print(" o'clock on ");

        switch (
month) {

        case (
1):
            
System.out.print("January ");
            break;

        case (
2):
            
System.out.print("February ");
            break;

        case (
3):
            
System.out.print("March ");
            break;

        case (
4):
            
System.out.print("April ");
            break;

        case (
5):
            
System.out.print("May ");
            break;

        case (
6):
            
System.out.print("June ");
            break;

        case (
7):
            
System.out.print("July ");
            break;

        case (
8):
            
System.out.print("August ");
            break;

        case (
9):
            
System.out.print("September ");
            break;

        case (
10):
            
System.out.print("October ");
            break;

        case (
11):
            
System.out.print("November ");
            break;

        case (
12):
            
System.out.print("December ");
            break;

        }
        
System.out.print(" " + day + ", " + year + ", ");

    }


} 
suerte!!!

Avisa si te funcionó....
__________________

Si algo puede fallar... fallará.

Última edición por aetrejo; 04/01/2005 a las 08:43