One of the central problems in software engineering is the inherent complexity. Since software is the result of human creative activity, cognitive informatics plays an important role in understanding its fundamental characteristics. In this research, a new software complexity measure based in terms of cognitiveweights of basic control structures has been proposed by trying to eliminate the limitations of some of the existing measures.Complexity of some problems with different line numbers has been measured for proposing an outline for an automatic student evaluation system which will distribute various questions or problems equally to various students based on the complexity of the problems, and then evaluate the answers automatically. Computer programming problems have been taken as the input of the evaluation system. At the end of the research, some complexity levelsaccording to the measured complexity value have been proposed. If a teacher wants to distribute sample problems, he can distribute it according to these levels.Application of the automatic evaluation system will help all students to get equal judgment in programming examination.