This project is due tonight and i have code that so far compiles becuase i commented a section of it out...but when i run it im getting a main error. here are the instrions for the assingment...
Clock Class

Write code that defines a Clock class according to these UML specs.
The hr instance variable records time on a 24 hour clock: 0 is midnight, 6 is 6am, 12 is noon and 23 is 11pm.

The constructor should create object with instance variables initialized to the time and date 0:00:00 January 1, 1 A.D.

The setTimeDate method should initialize the values of the instance variables. You choose the order of the parameters. You also decide what to do if any values are out of range.

When the tick method is executed, add one to sec. If the resulting value of sec is 60, set is back to 0 and update the other instance variables as necessary.


Write a TestClock class that tests all of the methods in your Clock class.
At a minimum, include these dates when testing the tick method: January 31, April 30, February 28 for leap and non-leap years, February 29 for leap and non-leap years, December 31.


Add code to your TestClock class that creates a Clock object initialized to the date and time 12 noon, January 24, 2008. Compute the dates 1 million and 10 million seconds in the future by repeatedly calling the tick method with for loops.
-------------------------------------------------------------------
This is the code i have so far...can anyone help me please i am desperate and begging for help....this is my code so far...
Java Code:
public class ClockRx {
    int sec; 
    int min;
    int hr;
    int day;
    int mon;
    int yr;

    public boolean isLeapYear( ) {
        return yr % 400 == 0 || (yr % 100 != 0 && yr % 4 == 0);
    }

    public void tick( ) {
        sec++;
        if (sec == 60) {
            sec = 0;
            min++;
        }

        if (min == 60) {
            min = 0;
            hr++;
        }

        if (hr == 24) {
            hr = 0;
            day++;
        }

        switch (mon) {
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                if (day == 32) {
                    day = 1;
                    mon++;
                }
                break;
            case 4:
            case 6:
            case 9:
            case 11:
                if (day == 31) {
                    day = 1;
                    mon++;
                }
                break;
            case 2:
                if ((isLeapYear( ) && day == 30) ||
                    (!isLeapYear( ) && day == 29)) {
                    day = 1;
                    mon++;
                }
                break;
            default:
                System.out.println("Illegal month.");
        }
    }

    public String getMonthName( ) {
        switch(mon) {
            case 1: return "January";
            case 2: return "February";
            case 3: return "March";
            case 4: return "April";
            case 5: return "May";
            case 6: return "June";
            case 7: return "July";
            case 8: return "August";
            case 9: return "September";
            case 10: return "October";
            case 11: return "November";
            case 12: return "December";
            default: return "Illegal month";
        }
/*
        if (mon == 13) {
            mon = 1;
            // "year" has not been declared
//            year++;
            // "yr" has
            yr++;
        }
*/
    }

    public String toString( ) {
        if (hr == 0)
            return String.format("%s %d, %d 12:%02d:%02d AM",
                                  getMonthName( ), day, yr, min, sec);
        else if (hr < 12)
            return String.format("%s %d, %d %02d:%02d:%02d AM",
                                  getMonthName( ), day, yr, hr, min, sec);
        else if (hr == 12)
            return String.format("%s %d, %d 12:%02d:%02d PM",
                                  getMonthName( ), day, yr, min, sec);
        else if (hr > 12 && hr < 24)
            return String.format("%s %d, %d %02d:%02d:%02d PM",
                                  getMonthName( ), day, yr, hr % 12, min, sec);
        else
            return "Illegal month";
    }
}