Question: Can you fix my code it says: On line 7 3 and 8 5 [ Error ] 'class studentList' has no memeber named 'end' #include
Can you fix my code it says: On line and Error 'class studentList' has no memeber named 'end'
#include
#include
#include
#include #include list
using namespace std;
ifstream infile;
struct studentNode
string firstName;
string lastName;
string id;
double gpa;
;
class studentList
list students;
public:
void addStudentconst studentNode& student
students.pushfrontstudent;
void deleteStudentconst string& id
for list::iterator it students.begin; it students.end; it
if itid id
students.eraseit;
cout "Student ID: id has been deleted" endl;
return;
cout "Student with ID: id not found" endl;
list::iterator locateStudentconst string& id
for list::iterator it students.begin; it students.end; it
if itid id
return it;
return students.end; Return end iterator if not found
void print
for list::iterator it students.begin; it students.end; it
cout itfirstName itlastName itid itgpa endl;
cout endl;
;
void processAddstudentList& students
studentNode s;
infile sfirstName;
infile slastName;
infile sid;
infile sgpa;
students.addStudents;
void processDeletestudentList& students
string id;
infile id;
students.deleteStudentid;
void processSearchstudentList& students
string id;
infile id;
list::iterator it students.locateStudentid;
Line : if it students.end
cout "Information Located: itfirstName itlastName itid itgpa endl;
else
cout "Information: id cannot be found." endl;
void processChangestudentList& students
string id;
double gpa;
infile id gpa;
list::iterator it students.locateStudentid;
Line : if it students.end
itgpa gpa;
else
cout "Student ID id not found" endl;
int main
char code;
studentList students;
infile.openupdatestxt;
while infile code
switch code
case A:
case a:
processAddstudents;
students.print;
break;
case D:
case d:
processDeletestudents;
students.print;
break;
case S:
case s:
processSearchstudents;
break;
case C:
case c:
processChangestudents;
students.print;
break;
default:
cout "Invalid code code endl;
break;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
