Life.me

public class Life extends Human {

    Boolean alive = false;
    String gender = null;
    int age = 0;
    DoB bday = null;

    public Life() {
        alive = true;
        age = 0;
        bday = getSysDate();
        if ((Math.random() % 2) == 0) {
            gender = "female";
        } else {
            gender = "male";
        }
    }

    public static void main(String arg[]) {
        Human human = new Life();
        while (true) {
            switch (age) {
                case studying:
                    human.doStudying(human);
		    break;
                case working:
                    human.doWork(human);
		    break;

                default:
                    human.byeBye(0);
		    break;
            }
        }
    }

    public void doStudy(Human human) {
        int i = 0;
        while (true) {
            human.geup();//what you do in the morning
            human.goToSchool();// study!
            human.getBackHome();
            human.doHomeWork();// is this necessary?

            if (fedup) {
                System.out.println("get a life!");
                break;
            }
            i++;
            if (i == 365) {
                age++;
                i = 0;
            }
            Thread.sleep();
        }
	}
	
	public void doWork(Human human) {
        int i = 0;
        while (true) {
            human.geup();//includes what you do in the morning
            human.goToWork();// work?
            human.getBackHome();
            if (fedup) {
                System.out.println("get a life!");
                break;
            }
            i++;
            if (i == 365) {
                age++;
                i = 0;
            }
            Thread.sleep();
        }
    }

    public void byeBye(int e) {
        System.exit(e);
    }
}

Feel free to add!!

Rusiru Boteju

Advertisements

10 thoughts on “Life.me

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s