A Student Has A First Name Fname A Last Name Iname An Identification Number Id A Gender Male Female A Course 1 (54.15 KiB) Viewed 67 times
A Student Has A First Name Fname A Last Name Iname An Identification Number Id A Gender Male Female A Course 2 (54.15 KiB) Viewed 67 times
A student has a first name (fname), a last name Iname), an identification number (id), a gender (male/female), a course name (cname) and the number of lectures (Icount) attended by the student a. Define gender as an enum b. Define a structure datatype (Student) with the members: frame. Iname and id are strings, and gender is enum. Create a function (read Students) to read the students' information from the provided input file, read the number of students, create vector of students to hold all information and fill it with the data read from the file. vector<Student> readStudents(string file name); c. Write a function (printStudent) that prints the student information void printStudent (const Student& st); d. Write a function (getFemales) that retur a vector of Students containing only female students. vector<student> getFemales(const vector student>& stds); c. Write a function (getLowAttenance) that retum a a vector of Students whose attendance is less than 20, vector<student> getLowAttendance(const vector Student>& stds); f. Write a main program that does the following: 1. Read the file content into a vector of Students, stds_vect b. Print all students' information on the console. c. Get the Female students and print their information on the console. d. Get the students with low attendance and print their information on the console. Content of students.txt ID Gender (enum 0:m, 1:1 First Name LName Course Attendance 1 Mohammad Saleh CMP220 30 Sara Ali CMP220 28 5 0 Charles Dickens CMP220 25 Jain Austin CMP220 23 Ahlam Mosteghanemi CMP220 15 Mario Puzo CMP220 Marie Curie CMP 220 30 1930 John Steinbeck CMP220 19 A sample output is given below: 2 4 19 21 88 21 WINDOWS The Female Students are ID [2] First Name [Sarel Last Lane A111 Gender resale) Course CO 229) Attendance [20 2014 First Name D2an Last Name Castin) Gender (Female) Course 109220 Attendance 1231 DR First Mahlas Last (route) Gender Female) Course () dance [15] EP 881 First Marie Last Name Curiel Gender resalej Course 09120 stance (7) the students with low Attendece are ID [19] Fest Name (Ahlan] Last Name (resteghanel Gender Female Course (220) Attendance [15] 10 (1970) Erste Sohn) last time steinbeck Gender Male] Course (220) Attendance (19) Fress any key to continge
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!