Created
October 20, 2011 20:07
-
-
Save thetekst/1302184 to your computer and use it in GitHub Desktop.
AlligatorTest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ru.thetekst.crocodile; | |
public class TestCrocodile { | |
public static void main(String[] args) throws InterruptedException { | |
Crocodile crocodile = new Crocodile(); | |
System.out.println(crocodile.getState()); | |
do{ | |
Thread.sleep(1000); | |
System.out.println(crocodile.getState()); | |
}while(crocodile.getWeight()<100); | |
crocodile.kill(); | |
System.out.println(crocodile.getState()); | |
} | |
} | |
/* | |
Input: | |
Крокодил жив, имеет вес: 20.0 | |
Крокодил жив, имеет вес: 40.0 | |
Крокодил жив, имеет вес: 60.0 | |
Крокодил жив, имеет вес: 80.0 | |
Крокодил жив, имеет вес: 100.0 | |
Крокодил мёртв | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment