BlueJ code
Added State Diagram