Write a program with 3 sub-functions to complete the following jobs:

Your output will be

The result file is followed: