Texas A&M University Interview Question

Write a programming function.