Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(I am posting again, please DO NOT use \"CLASS\".. and solve it in C++) Goals (1

ID: 3752160 • Letter: #

Question

(I am posting again, please DO NOT use "CLASS".. and solve it in C++)

Goals
(1) Learn how to use array for storing object pointers, instead of objects.
(2) Learn how to conduct Dynamical Memory Allocation by using the operators new and delete.

Requirements, Design and Implementation
The raw data of the student information are kept in the file StudentInfo.txt. 123456789 John Johnson 3.5
512434990 Mary Jackson 3.9
342432444 Peter Young 2.3
470068625 Jim Lee 2.9
234324324 Tammy Gaddis 3.1
121219000 Ester Schwab 2.7
The four columns in the file are: (1) student ID, (2) first name, (3) last name, and (4) GPA.
Design a struct named studentInfor for storing the data of the students. The program should read from the StudentInfo.txt and load the data in an array which stores the pointers of studentInfor objects. (The array should store the pointers, not he objects.) Implement three global functions as described below. display()
Displays the student information in four columns.
resetGPA()
Resets the GPAs of all students to 0.0.
sortStud()
Sorts the student records in the array in the sequence of ascending student IDs.
Display your output in the following manner: (1) display the student records in the way like they are stored in the studentInfo.txt file, (2) display the sorted student records, and (3) display student records with 0.0 GPA. (I am posting again, please DO NOT use "CLASS".. and solve it in C++)

Goals
(1) Learn how to use array for storing object pointers, instead of objects.
(2) Learn how to conduct Dynamical Memory Allocation by using the operators new and delete.

Requirements, Design and Implementation
The raw data of the student information are kept in the file StudentInfo.txt. 123456789 John Johnson 3.5
512434990 Mary Jackson 3.9
342432444 Peter Young 2.3
470068625 Jim Lee 2.9
234324324 Tammy Gaddis 3.1
121219000 Ester Schwab 2.7
The four columns in the file are: (1) student ID, (2) first name, (3) last name, and (4) GPA.
Design a struct named studentInfor for storing the data of the students. The program should read from the StudentInfo.txt and load the data in an array which stores the pointers of studentInfor objects. (The array should store the pointers, not he objects.) Implement three global functions as described below. display()
Displays the student information in four columns.
resetGPA()
Resets the GPAs of all students to 0.0.
sortStud()
Sorts the student records in the array in the sequence of ascending student IDs.
Display your output in the following manner: (1) display the student records in the way like they are stored in the studentInfo.txt file, (2) display the sorted student records, and (3) display student records with 0.0 GPA. (I am posting again, please DO NOT use "CLASS".. and solve it in C++)

Goals
(1) Learn how to use array for storing object pointers, instead of objects.
(2) Learn how to conduct Dynamical Memory Allocation by using the operators new and delete.

Requirements, Design and Implementation
The raw data of the student information are kept in the file StudentInfo.txt. 123456789 John Johnson 3.5
512434990 Mary Jackson 3.9
342432444 Peter Young 2.3
470068625 Jim Lee 2.9
234324324 Tammy Gaddis 3.1
121219000 Ester Schwab 2.7
The four columns in the file are: (1) student ID, (2) first name, (3) last name, and (4) GPA.
Design a struct named studentInfor for storing the data of the students. The program should read from the StudentInfo.txt and load the data in an array which stores the pointers of studentInfor objects. (The array should store the pointers, not he objects.) Implement three global functions as described below. display()
Displays the student information in four columns.
resetGPA()
Resets the GPAs of all students to 0.0.
sortStud()
Sorts the student records in the array in the sequence of ascending student IDs.
Display your output in the following manner: (1) display the student records in the way like they are stored in the studentInfo.txt file, (2) display the sorted student records, and (3) display student records with 0.0 GPA.

Explanation / Answer

source code:-
#include<iostream>
#include<iomanip>
#include<string.h>
#include<stdlib.h>
#include<fstream>
using namespace std;
struct Strudent_Records
{
int id;
char Name[100];
char Course_code[100];
int course_credit;
char grade;
};
struct Strudent_Records array[12];
class Student
{
public:
void display()
{
cout<<"----------------------------------------------------------------------"<<endl;
cout<<" Student ID"<<setw (15)<<"StudentName "<<setw
(10)<<"Cource_Code"<<setw (10)<<"Credits"<<setw (10)<<"Grade "<<endl;
cout<<"---------------------------------------------------------------------"<<endl;
for(int i=0;i<12;i++)
{
cout<<array[i].id<<setw (15)<<array[i].Name<<setw
(10)<<array[i].Course_code<<setw (10)<<array[i].course_credit<<setw
(10)<<array[i].grade<<endl;
}
}
public:
void Search()
{
char StudentName[100];
int flag=-1,count=0;
int start,end,total,sum=0;
cout<<" Enter The Student Name"<<endl;
cin>>StudentName;
for(int i=0;i<12;i++)
{
if(!(strcmp(StudentName,array[i].Name)))
{
if(count==0)
start=i;
count++;
flag=i;
end=i;
}
}
if(flag==-1)
{
cout<<" The Details Not Found"<<endl;
}
else
{
cout<<" The Student ID Number is:"<<array[start].id<<endl;
cout<<"Cource_Code"<<setw (10)<<"Credits"<<setw (10)<<"Grade "<<endl;
for(int i=start;i<end;i++)
{
cout<<array[i].Course_code<<setw (10)<<array[i].course_credit<<setw
(10)<<array[i].grade<<endl;
sum=sum+array[i].course_credit;
}
total=sum/count;
cout<<" The Total Semister Course Completed:"<<sum<<endl;
}
}
};
int main()
{
Student obj;
ifstream myfile;
int option;
myfile.open("studentGrades.rpt");
if(myfile.is_open())
{
for(int i=0;i<12;i++)
{
myfile>>array[i].id;
myfile>>array[i].Name;
myfile>>array[i].Course_code;
myfile>>array[i].course_credit;
myfile>>array[i].grade;
}
cout<<" The Content From The File is "<<endl;
cout<<"----------------------------------------------------------------------"<<endl;
cout<<" Student ID"<<setw (15)<<"StudentName "<<setw
(10)<<"Cource_Code"<<setw (10)<<"Credits"<<setw (10)<<"Grade "<<endl;
cout<<"---------------------------------------------------------------------"<<endl;
for(int i=0;i<12;i++)
{
cout<<array[i].id<<setw (15)<<array[i].Name<<setw
(10)<<array[i].Course_code<<setw (10)<<array[i].course_credit<<setw
(10)<<array[i].grade<<endl;
}
while(1)
{
cout<<" MENU"<<endl;
cout<<" 1.Display Records:"<<endl;
cout<<" 2.Find Semister GPA"<<endl;
cout<<" 3.Exit"<<endl;
cout<<" Select Any Option"<<endl;
cin>>option;
switch(option)
{
case 1:
obj.display();
break;
case 2:
obj.Search();
break;
case 3:
exit(0);
default:
cout<<" Invalid Option Please Choose Correct One"<<endl;
}
}
}
else
{
cout<<" ! Couldn't Able to Open The File"<<endl;
}
}


input file:
2333021 BOKOW,R NS201 3 A
2333021 BOKOW,R MG242 3 A
2333021 BOKOW,R FA302 1 A
2574063 FALLIN,D MC106 3 C
2574063 FALLIN,D MA208 3 B
2574063 FALLIN,D CM201 3 C
2574063 FALLIN,D CP101 2 B
2332638 KINGSLAY,L QA141 3 A
2332638 KINGSLAY,L CM245 3 B
2332638 KINGSLAY,L FQ521 3 A
2332638 KINGSLAY,L MC341 3 A
2332638 KINGSLAY,L CP101 2 B