2. Write programs according to the requests. (80 scores)