complete all codes in Terminal.java