Below are codes for programs, the codes will be placed in order by numbers.
1)There are two sets of code here in number 1, one code with functions(modules), and 1 without functions(modules).
2)A code with functions(modules).