A comprehensive approach to teaching electromagnetics at the senior undergraduate level is described. The main objective of this paper is the development of computer-assisted educational material to teach the theoretical and practical aspects of electromagnetics. This comprehensive approach has allowed us to teach electromagnetics in a new and effective way helping our students master this difficult subject. In particular, virtual experiments have been designed that the students perform before attempting the corresponding real experiments. These virtual experiments help the students to appreciate the essential nature of an experiment without being confused or distracted by the complications of the real experimental procedures.