Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1: A student has a rst name (mm, a last name Gimme), an identication number (id), a gender (male/female), a course name (warm) and

image text in transcribedimage text in transcribed
Question 1: A student has a rst name (mm, a last name Gimme), an identication number (id), a gender (male/female), a course name (warm) and the number of lectures (mint) attended by the student. a9 b0 Dene gender as an m class Dene a class datatype (Student) with the private members: mam 131m id, and game are strings; W is an Egg; and gender is an object of type Gender. This class should have the following functions: 1. A default constructor to initialize all strings to \"None\" all integers to 0 and the gender to Female. 2. A constructor with parameters. 3. A print function that prints the student info. 4. Getter/Accessors and Setters/Mutators for all private data members. Create a function (W) to read the students' information from the provided input le; read the number of students, create vector of students to hold all information and ll it with the data read from the le. In this function you should read the values into temporary variables, create an object of the type Student using the non-default constructor, and push it to the vector of Students. vector readStudentsgstring file name); Write a function (MW that m students' information. void grintStudentsgconst vector gggg); Write a lnction (W that returns a vector of Students containing only female students. vector getFemalesgconst vector& gggg); Write a function (me) that returns a vector of Students whose attendance is less than 20. vector getLowAttendancegconst vector& ago; Write a m to: 1 read the le content into a vector of Students, W. print all students' information on the console. 2. 3. get the female students and print their information on the console. 4. get the students with low attendance and print their information on the console. Content of students.txt 8 ID Gender (enum 0:m, 1:f) First Name LName Course Attendance Mohammad Saleh CMP 220 30 Sara Ali CMP220 28 Charles Dickens CMP220 25 Jain Austin CMP220 23 OHOH HO HO 19 Ahlam Mosteghanemi CMP220 15 Mario Puzo CMP220 21 88 Marie Curie CMP220 30 1930 John Steinbeck CMP220 19 A sample output is given below: All Students ID [1] First Name [Mohammad] Last Name [Saleh] Gender [Male] Course [CMP220] Attendance [30] ID [2] First Name [Sara] Last Name [Ali] Gender [Female] Course [CMP220] Attendance [28] ID [5] First Name [Charles] Last Name [Dickens] Gender [Male] Course [CMP220] Attendance [25] ID [4] First Name [Jain] Last Name [Austin] Gender [Female] Course [CMP220] Attendance [23] ID [19] First Name [Ahlam] Last Name [Mosteghanemi] Gender [Female] Course [CMP220] Attendance [15] ID [21] First Name [Mario] Last Name [Puzo] Gender [Male] Course [CMP220] Attendance [21] ID [88] First Name [Marie] Last Name [Curie] Gender [Female] Course [CMP220] Attendance [30] ID [1930] First Name [John] Last Name [Steinbeck] Gender [Male] Course [CMP220] Attendance [19] The Female Students are : ID [2] First Name [Sara] Last Name [Ali] Gender [Female] Course [CMP220] Attendance [28] ID [4] First Name [Jain] Last Name [Austin] Gender [Female] Course [CMP220] Attendance [23] ID [19] First Name [Ahlam] Last Name [Mosteghanemi] Gender [Female] Course [CMP220] Attendance [15] ID [88] First Name [Marie] Last Name [Curie] Gender [Female] Course [CMP220] Attendance [30] The Students with low Attendance are: ID [19] First Name [Ahlam] Last Name [Mosteghanemi] Gender [Female] Course [CMP220] Attendance [15] ID [1930] First Name [John] Last Name [Steinbeck] Gender [Male] Course [CMP220] Attendance [19]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions