Programming homework of AP Computer Science. Book Java Concept Chapter 3.