I have created this program for an assignment.