A file of student records contains name, gender (M or F), age (in years) and marital status (single or married) for each student.

A file of student records contains name, gender (M or F), age (in years) andmarital status (single or married) for each student. Design an algorithm thatwill read through the file and calculate the numbers of married men, singlemen, married women and single women. Print these numbers on a studentsummary report. If any single men are over 30 years of age, print their namesand ages on a separate eligible bachelors report.