SlideShare a Scribd company logo
Program 24 "Sorting Students" Write a C++ program that will open a file named stDATA.txt.
This file contains an unknown number of student records, one per line. The total number of
records will be less than or equal to 100. Your program should print a list of students sorted by
GPA. If two students have the same GPA they should be sub-sorted by classification (SR, JR,
SO, FR). If two students have the same GPA and the same classification, they should be sub-
sorted by last name. If two students have the same GPA, classification, and last name they
should be sub-sorted by first name. If two students have the same GPA, classification, last name
and first name, the second student's record should not be printed; instead the message: "I
THINK THIS IS A DUPLICATE RECORD" should be printed. [edit]Deliverables main.cpp
prog24Functions.h prog24Functions.cpp Sample data file: FirstName LastName CLASS ZIP
AGE HomeTown GPA Hailee Ferrel FR 72275 20 Layton 3.63 Perry Caldwell-Reed SO 4164
19 Racine 2.96 Andrew Dawson JR 39123 21 Huntington 2.29 William Senser SR 15886 25
Fontana 2.14 Shelby Santiago FR 57021 23 Winter 3.15 Matthew Brannon SO 54064 18 Santa
3.35 Christopher Kou JR 31907 22 Monroe 2.36 Cassidy Monjaras SR 41928 24 Jefferson 2.13
Lauren Shah FR 65008 23 Visalia 2.66 Jonathan Quintanilla SO 79343 16 Howell 3.69 Andrew
Chen JR 86176 18 Brownsville 3.32 Brendel Unruh SR 37743 20 Lansing 2.48 Christopher
Royse FR 8095 22 Anchorage 3.98 Jose Harrison SO 33128 17 Greenville 2.09 Alexander
Seiford JR 96517 16 Greenville 2.88 Quinton Johnson SR 56102 20 Winston 3.89 Tristan
Gardner FR 74489 21 Brighton 2.22 Alexander Motz SO 49195 24 Cathedral 3.13 Molly Atkins
JR 27698 15 Des 3.54 William Savells SR 17951 19 Shreveport 3.16 Shawn Wilcoxen FR 86284
21 Syracuse 3.11 Austin Hardy SO 73491 15 Birmingham 2.52 Jason Ammons JR 94515 22
Atlanta 2.86 Phillip Dutta SR 19503 19 Milwaukee 2.34 Wesley Elliott FR 8885 17 Eugene 2.64
Alexander Childers SO 55503 17 Thornton 2.76 Cameron Jones JR 77131 20 New 2.56 Jessica
Louis SR 66868 24 Asheville 3.41 Ryan Kliphon FR 6054 16 Kissimmee 3.26 Zachariah
Qureshi SO 18845 19 Harlingen 2.65 Ryan Cadenas JR 35181 16 Olathe 3.45 Chandrima Bryant
SR 64898 18 Chicago 3.74 Doraliz Hansen FR 30588 23 Boston 2.61 Alonso Greer SO 94115
20 Victorville 3.19 David Llamas JR 84133 19 Hesperia 2.54 Caleb Dylag SR 35101 15
Sebastian 3.91 Rachel Zust FR 42196 16 Westminster 2.74 Tyler DeRosa SO 14421 19
Westminster 3.21 Kendall Sedate JR 43036 22 Moreno 2.29 Matthew Ortiz-Vitali SR 14801 22
Cary 2.03 Ryan Al-Nimri FR 53238 16 Mission 3.75 Daniel Dratz SO 59534 22 Mission 2.83
Weston Gage JR 56011 18 Macon 2.43 Asad Riggins SR 67131 25 Macon 2.06 John Thompson
FR 15386 21 Olympia 3.82 James Seunsom SO 42143 21 Richmond 3.58 Corbin Bodden JR
32787 16 Provo 2.96 Allison Veselka SR 99047 21 Wilmington 3.35 Shawn Renton FR 74027
24 Fort 2.21 Michael Martin SO 74146 16 Bryan 2.82 Austin Huizinga JR 49494 15 Leominster
3.35 Caleb Berkovsky SR 3711 24 Leominster 3.51 Taylor Brown FR 69305 24 Kailua 2.18
Elizabeth Taylor SO 54950 17 Tempe 2.95 Alexandra Itskin JR 35943 16 Denver 3.12 Reagan
Zipoy SR 3892 16 Pomona 2.70 Edgar Leblanc FR 52703 22 Riverside 3.12 Brian Stevens SO
93293 23 Nashua 3.26 Sam Pearson JR 69161 17 Danbury 3.14 Colin Peterson SR 77027 24
Gulfport-Biloxi 2.72 Diana Sharpe FR 65253 22 Palmdale 3.35 Ching-Jung Labrada SO 48635
20 Aberdeen 3.93 Roberto Haddad JR 69486 19 Escondido 2.70 Mahlet Shifflet SR 82554 15
Appleton 3.32 Parker Miller FR 93219 20 South 2.32 Matthew Leake SO 49468 19 Mesa 3.55
Corey McBrayer JR 71592 18 Santa 2.45 David Tramontano SR 38229 24 Murrieta 3.51 John
Rundquist FR 78321 16 Clarke 2.42 Caroline Christenberry SO 42590 24 Poughkeepsie 3.04
Ashley Thomas JR 86691 17 Louisville 2.95 Kyle Andras SR 43291 25 Bakersfield 2.62 Trey
Bolling FR 74843 16 Muskegon 3.79 Adam Brown SO 76537 21 Fort 3.89 Michael Handley JR
58339 19 Lancaster 2.29 Andrew Zinah SR 88135 22 Odessa 3.55 Shawn Wilcoxen FR 86284
21 Syracuse 3.11 Austin Hardy SO 73491 15 Birmingham 2.52 Jason Ammons JR 94515 22
Atlanta 2.86 Phillip Dutta SR 19503 19 Milwaukee 2.34 Wesley Elliott FR 8885 17 Eugene 2.64
Phillip Dutta SR 19503 19 Milwaukee 2.34 Wesley Elliott FR 8885 17 Eugene 2.64 Diana
Sharpe FR 65253 22 Palmdale 3.35 Diana Sharpe FR 65253 22 Palmdale 3.35 Diana Sharpe FR
65253 22 Palmdale 3.35 Sample Output: First Name Last Name Class Zip Age HomeTown GPA
Matthew Ortiz-Vitali SR 14801 22 Cary 2.03 Asad Riggins SR 67131 25 Macon 2.06 Jose
Harrison SO 33128 17 Greenville 2.09 Cassidy Monjaras SR 41928 24 Jefferson 2.13 William
Senser SR 15886 25 Fontana 2.14 Taylor Brown FR 69305 24 Kailua 2.18 Shawn Renton FR
74027 24 Fort 2.21 Tristan Gardner FR 74489 21 Brighton 2.22 Andrew Dawson JR 39123 21
Huntington 2.29 Michael Handley JR 58339 19 Lancaster 2.29 Kendall Sedate JR 43036 22
Moreno 2.29 Parker Miller FR 93219 20 South 2.32 Phillip Dutta SR 19503 19 Milwaukee 2.34
I THINK THIS IS A DUPLICATE RECORD I THINK THIS IS A DUPLICATE RECORD
Christopher Kou JR 31907 22 Monroe 2.36 John Rundquist FR 78321 16 Clarke 2.42 Weston
Gage JR 56011 18 Macon 2.43 Corey McBrayer JR 71592 18 Santa 2.45 Brendel Unruh SR
37743 20 Lansing 2.48 Austin Hardy SO 73491 15 Birmingham 2.52 I THINK THIS IS A
DUPLICATE RECORD David Llamas JR 84133 19 Hesperia 2.54 Cameron Jones JR 77131 20
New 2.56 Doraliz Hansen FR 30588 23 Boston 2.61 Kyle Andras SR 43291 25 Bakersfield 2.62
Wesley Elliott FR 8885 17 Eugene 2.64 I THINK THIS IS A DUPLICATE RECORD I THINK
THIS IS A DUPLICATE RECORD Zachariah Qureshi SO 18845 19 Harlingen 2.65 Lauren
Shah FR 65008 23 Visalia 2.66 Roberto Haddad JR 69486 19 Escondido 2.70 Reagan Zipoy SR
3892 16 Pomona 2.70 Colin Peterson SR 77027 24 Gulfport-Biloxi 2.72 Rachel Zust FR 42196
16 Westminster 2.74 Alexander Childers SO 55503 17 Thornton 2.76 Michael Martin SO 74146
16 Bryan 2.82 Daniel Dratz SO 59534 22 Mission 2.83 Jason Ammons JR 94515 22 Atlanta 2.86
I THINK THIS IS A DUPLICATE RECORD Alexander Seiford JR 96517 16 Greenville 2.88
Ashley Thomas JR 86691 17 Louisville 2.95 Elizabeth Taylor SO 54950 17 Tempe 2.95 Corbin
Bodden JR 32787 16 Provo 2.96 Perry Caldwell-Reed SO 4164 19 Racine 2.96 Caroline
Christenberry SO 42590 24 Poughkeepsie 3.04 Shawn Wilcoxen FR 86284 21 Syracuse 3.11 I
THINK THIS IS A DUPLICATE RECORD Edgar Leblanc FR 52703 22 Riverside 3.12
Alexandra Itskin JR 35943 16 Denver 3.12 Alexander Motz SO 49195 24 Cathedral 3.13 Sam
Pearson JR 69161 17 Danbury 3.14 Shelby Santiago FR 57021 23 Winter 3.15 William Savells
SR 17951 19 Shreveport 3.16 Alonso Greer SO 94115 20 Victorville 3.19 Tyler DeRosa SO
14421 19 Westminster 3.21 Ryan Kliphon FR 6054 16 Kissimmee 3.26 Brian Stevens SO 93293
23 Nashua 3.26 Andrew Chen JR 86176 18 Brownsville 3.32 Mahlet Shifflet SR 82554 15
Appleton 3.32 Diana Sharpe FR 65253 22 Palmdale 3.35 I THINK THIS IS A DUPLICATE
RECORD I THINK THIS IS A DUPLICATE RECORD I THINK THIS IS A DUPLICATE
RECORD Austin Huizinga JR 49494 15 Leominster 3.35 Matthew Brannon SO 54064 18 Santa
3.35 Allison Veselka SR 99047 21 Wilmington 3.35 Jessica Louis SR 66868 24 Asheville 3.41
Ryan Cadenas JR 35181 16 Olathe 3.45 Caleb Berkovsky SR 3711 24 Leominster 3.51 David
Tramontano SR 38229 24 Murrieta 3.51 Molly Atkins JR 27698 15 Des 3.54 Matthew Leake SO
49468 19 Mesa 3.55 Andrew Zinah SR 88135 22 Odessa 3.55 James Seunsom SO 42143 21
Richmond 3.58 Hailee Ferrel FR 72275 20 Layton 3.63 Jonathan Quintanilla SO 79343 16
Howell 3.69 Chandrima Bryant SR 64898 18 Chicago 3.74 Ryan Al-Nimri FR 53238 16 Mission
3.75 Trey Bolling FR 74843 16 Muskegon 3.79 John Thompson FR 15386 21 Olympia 3.82
Adam Brown SO 76537 21 Fort 3.89 Quinton Johnson SR 56102 20 Winston 3.89 Caleb Dylag
SR 35101 15 Sebastian 3.91 Ching-Jung Labrada SO 48635 20 Aberdeen 3.93 Christopher
Royse FR 8095 22 Anchorage 3.98
Solution
#include
#include
using namespace std;
//student class to capture students data
class Student
{
//instance c=variables for students
public:
string fname;
string lname;
string classs;
int zip;
int age;
string town;
float gpa;
//constructor
Student(string fn,string ln,string c,int z,int a,string h,float g)
{
fname=fn;
lname=ln;
classs=c;
zip=z;
age=a;
town=h;
gpa=g;
}
//default constructor
Student()
{
}
};
//function to read data frm file
//returns no of records read
int readFromFile(Student students[100])
{
int size=0;
string fname,lname,town,classs;
int zip,age;
float gpa;
ifstream myfile ("stDATA.txt");
if (myfile.is_open())
{
getline(myfile,fname);
while ( myfile>>fname )
{
myfile>>lname;
myfile>>classs;
myfile>>zip;
myfile>>age;
myfile>>town;
myfile>>gpa;
students[size]=Student(fname,lname,classs,zip,age,town,gpa);
size++;
}
myfile.close();
}
else cout << "Unable to open file";
return size;
}
//display student read
void display(Student students[],int size)
{
cout<<" NamettCLASSt ZIPt AGEt HomeTownt GPA";
for(int i=0;i students[j].gpa)
{
tmp = students[i];
students[i] = students[j];
students[j] = tmp;
}
//if students gpa match,then compare classifictaion
else
if(students[i].gpa==students[j].gpa)
{
if(students[i].classs >students[j].classs)
{
tmp = students[i];
students[i] = students[j];
students[j] = tmp;
}
//if students gpa and classfictaion match, compare lname
else
if(students[i].classs == students[j].classs)
{
if(students[i].lname >students[j].lname)
{
tmp = students[i];
students[i] = students[j];
students[j] = tmp;
}
// f students gpa and classfictaion and lname match, compare fname
else
if(students[i].lname == students[j].lname)
{
if(students[i].fname >students[j].fname)
{
tmp = students[i];
students[i] = students[j];
students[j] = tmp;
}
// if students gpa and classfictaion and lname and fname match it emans it's a
duplkictae record
//set a flag to identify it
else
if(students[i].fname ==students[j].fname)
{
students[j].fname="Duplicate";
}
}
}
}
}
}
//sort
}
//main fucntion which triggers
int main()
{
Student students[100];
int size=readFromFile(students);
sort(students,size);
display(students,size);
cout<

More Related Content

Similar to Program 24 Sorting Students Write a C++ program that will open a.pdf

League table web 09
League table web 09League table web 09
League table web 09
mickbrown60
 
Web format league results 15-11
Web format   league results 15-11Web format   league results 15-11
Web format league results 15-11
mickbrown60
 
League table web 03
League table web 03League table web 03
League table web 03
mickbrown60
 
Web format league results 15-12
Web format   league results 15-12Web format   league results 15-12
Web format league results 15-12
mickbrown60
 
Web format league results 15-13
Web format   league results 15-13Web format   league results 15-13
Web format league results 15-13
mickbrown60
 
REGIONAL TRACK RANKINGS
REGIONAL TRACK RANKINGSREGIONAL TRACK RANKINGS
REGIONAL TRACK RANKINGS
UTTylerPatriots
 
League table web final
League table web finalLeague table web final
League table web final
mickbrown60
 
League table web 08
League table web 08League table web 08
League table web 08
mickbrown60
 
Web format league results 15-9
Web format   league results 15-9Web format   league results 15-9
Web format league results 15-9
mickbrown60
 
Web format league results 15-9
Web format   league results 15-9Web format   league results 15-9
Web format league results 15-9
mickbrown60
 
Web format league results 15-10
Web format   league results 15-10Web format   league results 15-10
Web format league results 15-10
mickbrown60
 
Baseball Metrics and player
Baseball Metrics and playerBaseball Metrics and player
Baseball Metrics and player
Kristi Karkut
 
Angelo State Baseball (Fall World Series)
Angelo State Baseball (Fall World Series)Angelo State Baseball (Fall World Series)
Angelo State Baseball (Fall World Series)
AngeloStateSports
 
Web format league results 15-14
Web format   league results 15-14Web format   league results 15-14
Web format league results 15-14
mickbrown60
 
League table web 05
League table web 05League table web 05
League table web 05
mickbrown60
 
Web format league results 15 -1
Web format   league results 15 -1Web format   league results 15 -1
Web format league results 15 -1
mickbrown60
 
Scores 4 18 15
Scores 4 18 15Scores 4 18 15
Scores 4 18 15
Justin Miller
 
NCAA Division III South/Southeast Men’s Cross Country Championships
NCAA Division III South/Southeast Men’s Cross Country Championships NCAA Division III South/Southeast Men’s Cross Country Championships
NCAA Division III South/Southeast Men’s Cross Country Championships
UTTylerPatriots
 
Web format league results 15-6
Web format   league results 15-6Web format   league results 15-6
Web format league results 15-6
mickbrown60
 
Ff1 2020 01_results
Ff1 2020 01_resultsFf1 2020 01_results
Ff1 2020 01_results
mickbrown60
 

Similar to Program 24 Sorting Students Write a C++ program that will open a.pdf (20)

League table web 09
League table web 09League table web 09
League table web 09
 
Web format league results 15-11
Web format   league results 15-11Web format   league results 15-11
Web format league results 15-11
 
League table web 03
League table web 03League table web 03
League table web 03
 
Web format league results 15-12
Web format   league results 15-12Web format   league results 15-12
Web format league results 15-12
 
Web format league results 15-13
Web format   league results 15-13Web format   league results 15-13
Web format league results 15-13
 
REGIONAL TRACK RANKINGS
REGIONAL TRACK RANKINGSREGIONAL TRACK RANKINGS
REGIONAL TRACK RANKINGS
 
League table web final
League table web finalLeague table web final
League table web final
 
League table web 08
League table web 08League table web 08
League table web 08
 
Web format league results 15-9
Web format   league results 15-9Web format   league results 15-9
Web format league results 15-9
 
Web format league results 15-9
Web format   league results 15-9Web format   league results 15-9
Web format league results 15-9
 
Web format league results 15-10
Web format   league results 15-10Web format   league results 15-10
Web format league results 15-10
 
Baseball Metrics and player
Baseball Metrics and playerBaseball Metrics and player
Baseball Metrics and player
 
Angelo State Baseball (Fall World Series)
Angelo State Baseball (Fall World Series)Angelo State Baseball (Fall World Series)
Angelo State Baseball (Fall World Series)
 
Web format league results 15-14
Web format   league results 15-14Web format   league results 15-14
Web format league results 15-14
 
League table web 05
League table web 05League table web 05
League table web 05
 
Web format league results 15 -1
Web format   league results 15 -1Web format   league results 15 -1
Web format league results 15 -1
 
Scores 4 18 15
Scores 4 18 15Scores 4 18 15
Scores 4 18 15
 
NCAA Division III South/Southeast Men’s Cross Country Championships
NCAA Division III South/Southeast Men’s Cross Country Championships NCAA Division III South/Southeast Men’s Cross Country Championships
NCAA Division III South/Southeast Men’s Cross Country Championships
 
Web format league results 15-6
Web format   league results 15-6Web format   league results 15-6
Web format league results 15-6
 
Ff1 2020 01_results
Ff1 2020 01_resultsFf1 2020 01_results
Ff1 2020 01_results
 

More from ezzi97

Explain why multiple processes cannot share data easilySolution.pdf
Explain why multiple processes cannot share data easilySolution.pdfExplain why multiple processes cannot share data easilySolution.pdf
Explain why multiple processes cannot share data easilySolution.pdf
ezzi97
 
executive summary for law enforcement using dronesSolutionUse .pdf
executive summary for law enforcement using dronesSolutionUse .pdfexecutive summary for law enforcement using dronesSolutionUse .pdf
executive summary for law enforcement using dronesSolutionUse .pdf
ezzi97
 
Discuss how your life and experience with social mediaweb 2.0 compa.pdf
Discuss how your life and experience with social mediaweb 2.0 compa.pdfDiscuss how your life and experience with social mediaweb 2.0 compa.pdf
Discuss how your life and experience with social mediaweb 2.0 compa.pdf
ezzi97
 
create a narrative budget blueprint for a local unit of government. .pdf
create a narrative budget blueprint for a local unit of government. .pdfcreate a narrative budget blueprint for a local unit of government. .pdf
create a narrative budget blueprint for a local unit of government. .pdf
ezzi97
 
define three types of kernal-mode to user mode transfersSolution.pdf
define three types of kernal-mode to user mode transfersSolution.pdfdefine three types of kernal-mode to user mode transfersSolution.pdf
define three types of kernal-mode to user mode transfersSolution.pdf
ezzi97
 
Arrange the steps of DNA replication in the order that they occur. D.pdf
Arrange the steps of DNA replication in the order that they occur.  D.pdfArrange the steps of DNA replication in the order that they occur.  D.pdf
Arrange the steps of DNA replication in the order that they occur. D.pdf
ezzi97
 
C++You will design a program to play a simplified version of war, .pdf
C++You will design a program to play a simplified version of war, .pdfC++You will design a program to play a simplified version of war, .pdf
C++You will design a program to play a simplified version of war, .pdf
ezzi97
 
(c) After conducting several measurements, the Beijing Municipal Env.pdf
(c) After conducting several measurements, the Beijing Municipal Env.pdf(c) After conducting several measurements, the Beijing Municipal Env.pdf
(c) After conducting several measurements, the Beijing Municipal Env.pdf
ezzi97
 
1. Which of the following statements would correctly print out t.pdf
1. Which of the following statements would correctly print out t.pdf1. Which of the following statements would correctly print out t.pdf
1. Which of the following statements would correctly print out t.pdf
ezzi97
 
2.How important is it to involve physicians in financial improvement.pdf
2.How important is it to involve physicians in financial improvement.pdf2.How important is it to involve physicians in financial improvement.pdf
2.How important is it to involve physicians in financial improvement.pdf
ezzi97
 
Write one page essay to explain how you relate signals and systems t.pdf
Write one page essay to explain how you relate signals and systems t.pdfWrite one page essay to explain how you relate signals and systems t.pdf
Write one page essay to explain how you relate signals and systems t.pdf
ezzi97
 
Why do IDPs & IDRs lack structure Lack a ligand or partner Denatu.pdf
Why do IDPs & IDRs lack structure  Lack a ligand or partner  Denatu.pdfWhy do IDPs & IDRs lack structure  Lack a ligand or partner  Denatu.pdf
Why do IDPs & IDRs lack structure Lack a ligand or partner Denatu.pdf
ezzi97
 
Write 2 to 3 paragraphs aboutONE DDoS attack that occurred in 2016.pdf
Write 2 to 3 paragraphs aboutONE DDoS attack that occurred in 2016.pdfWrite 2 to 3 paragraphs aboutONE DDoS attack that occurred in 2016.pdf
Write 2 to 3 paragraphs aboutONE DDoS attack that occurred in 2016.pdf
ezzi97
 
Why is methyl salicylate not appreciably soluble in waterSoluti.pdf
Why is methyl salicylate not appreciably soluble in waterSoluti.pdfWhy is methyl salicylate not appreciably soluble in waterSoluti.pdf
Why is methyl salicylate not appreciably soluble in waterSoluti.pdf
ezzi97
 
Who are stakeholders Define who they are and then please share what.pdf
Who are stakeholders Define who they are and then please share what.pdfWho are stakeholders Define who they are and then please share what.pdf
Who are stakeholders Define who they are and then please share what.pdf
ezzi97
 
What was the biggest problem with the Articles of Confederation They.pdf
What was the biggest problem with the Articles of Confederation They.pdfWhat was the biggest problem with the Articles of Confederation They.pdf
What was the biggest problem with the Articles of Confederation They.pdf
ezzi97
 
What is UWIN and what does it doSolutionUWin is a software .pdf
What is UWIN and what does it doSolutionUWin is a software .pdfWhat is UWIN and what does it doSolutionUWin is a software .pdf
What is UWIN and what does it doSolutionUWin is a software .pdf
ezzi97
 
What sort of archaeological remains have been discovered on the site.pdf
What sort of archaeological remains have been discovered on the site.pdfWhat sort of archaeological remains have been discovered on the site.pdf
What sort of archaeological remains have been discovered on the site.pdf
ezzi97
 
Link to assignment that I need help with is below httpweb.cse..pdf
Link to assignment that I need help with is below httpweb.cse..pdfLink to assignment that I need help with is below httpweb.cse..pdf
Link to assignment that I need help with is below httpweb.cse..pdf
ezzi97
 
The Food Stamp Program is Americas first line of defense against hu.pdf
The Food Stamp Program is Americas first line of defense against hu.pdfThe Food Stamp Program is Americas first line of defense against hu.pdf
The Food Stamp Program is Americas first line of defense against hu.pdf
ezzi97
 

More from ezzi97 (20)

Explain why multiple processes cannot share data easilySolution.pdf
Explain why multiple processes cannot share data easilySolution.pdfExplain why multiple processes cannot share data easilySolution.pdf
Explain why multiple processes cannot share data easilySolution.pdf
 
executive summary for law enforcement using dronesSolutionUse .pdf
executive summary for law enforcement using dronesSolutionUse .pdfexecutive summary for law enforcement using dronesSolutionUse .pdf
executive summary for law enforcement using dronesSolutionUse .pdf
 
Discuss how your life and experience with social mediaweb 2.0 compa.pdf
Discuss how your life and experience with social mediaweb 2.0 compa.pdfDiscuss how your life and experience with social mediaweb 2.0 compa.pdf
Discuss how your life and experience with social mediaweb 2.0 compa.pdf
 
create a narrative budget blueprint for a local unit of government. .pdf
create a narrative budget blueprint for a local unit of government. .pdfcreate a narrative budget blueprint for a local unit of government. .pdf
create a narrative budget blueprint for a local unit of government. .pdf
 
define three types of kernal-mode to user mode transfersSolution.pdf
define three types of kernal-mode to user mode transfersSolution.pdfdefine three types of kernal-mode to user mode transfersSolution.pdf
define three types of kernal-mode to user mode transfersSolution.pdf
 
Arrange the steps of DNA replication in the order that they occur. D.pdf
Arrange the steps of DNA replication in the order that they occur.  D.pdfArrange the steps of DNA replication in the order that they occur.  D.pdf
Arrange the steps of DNA replication in the order that they occur. D.pdf
 
C++You will design a program to play a simplified version of war, .pdf
C++You will design a program to play a simplified version of war, .pdfC++You will design a program to play a simplified version of war, .pdf
C++You will design a program to play a simplified version of war, .pdf
 
(c) After conducting several measurements, the Beijing Municipal Env.pdf
(c) After conducting several measurements, the Beijing Municipal Env.pdf(c) After conducting several measurements, the Beijing Municipal Env.pdf
(c) After conducting several measurements, the Beijing Municipal Env.pdf
 
1. Which of the following statements would correctly print out t.pdf
1. Which of the following statements would correctly print out t.pdf1. Which of the following statements would correctly print out t.pdf
1. Which of the following statements would correctly print out t.pdf
 
2.How important is it to involve physicians in financial improvement.pdf
2.How important is it to involve physicians in financial improvement.pdf2.How important is it to involve physicians in financial improvement.pdf
2.How important is it to involve physicians in financial improvement.pdf
 
Write one page essay to explain how you relate signals and systems t.pdf
Write one page essay to explain how you relate signals and systems t.pdfWrite one page essay to explain how you relate signals and systems t.pdf
Write one page essay to explain how you relate signals and systems t.pdf
 
Why do IDPs & IDRs lack structure Lack a ligand or partner Denatu.pdf
Why do IDPs & IDRs lack structure  Lack a ligand or partner  Denatu.pdfWhy do IDPs & IDRs lack structure  Lack a ligand or partner  Denatu.pdf
Why do IDPs & IDRs lack structure Lack a ligand or partner Denatu.pdf
 
Write 2 to 3 paragraphs aboutONE DDoS attack that occurred in 2016.pdf
Write 2 to 3 paragraphs aboutONE DDoS attack that occurred in 2016.pdfWrite 2 to 3 paragraphs aboutONE DDoS attack that occurred in 2016.pdf
Write 2 to 3 paragraphs aboutONE DDoS attack that occurred in 2016.pdf
 
Why is methyl salicylate not appreciably soluble in waterSoluti.pdf
Why is methyl salicylate not appreciably soluble in waterSoluti.pdfWhy is methyl salicylate not appreciably soluble in waterSoluti.pdf
Why is methyl salicylate not appreciably soluble in waterSoluti.pdf
 
Who are stakeholders Define who they are and then please share what.pdf
Who are stakeholders Define who they are and then please share what.pdfWho are stakeholders Define who they are and then please share what.pdf
Who are stakeholders Define who they are and then please share what.pdf
 
What was the biggest problem with the Articles of Confederation They.pdf
What was the biggest problem with the Articles of Confederation They.pdfWhat was the biggest problem with the Articles of Confederation They.pdf
What was the biggest problem with the Articles of Confederation They.pdf
 
What is UWIN and what does it doSolutionUWin is a software .pdf
What is UWIN and what does it doSolutionUWin is a software .pdfWhat is UWIN and what does it doSolutionUWin is a software .pdf
What is UWIN and what does it doSolutionUWin is a software .pdf
 
What sort of archaeological remains have been discovered on the site.pdf
What sort of archaeological remains have been discovered on the site.pdfWhat sort of archaeological remains have been discovered on the site.pdf
What sort of archaeological remains have been discovered on the site.pdf
 
Link to assignment that I need help with is below httpweb.cse..pdf
Link to assignment that I need help with is below httpweb.cse..pdfLink to assignment that I need help with is below httpweb.cse..pdf
Link to assignment that I need help with is below httpweb.cse..pdf
 
The Food Stamp Program is Americas first line of defense against hu.pdf
The Food Stamp Program is Americas first line of defense against hu.pdfThe Food Stamp Program is Americas first line of defense against hu.pdf
The Food Stamp Program is Americas first line of defense against hu.pdf
 

Recently uploaded

Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 

Recently uploaded (20)

Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 

Program 24 Sorting Students Write a C++ program that will open a.pdf

  • 1. Program 24 "Sorting Students" Write a C++ program that will open a file named stDATA.txt. This file contains an unknown number of student records, one per line. The total number of records will be less than or equal to 100. Your program should print a list of students sorted by GPA. If two students have the same GPA they should be sub-sorted by classification (SR, JR, SO, FR). If two students have the same GPA and the same classification, they should be sub- sorted by last name. If two students have the same GPA, classification, and last name they should be sub-sorted by first name. If two students have the same GPA, classification, last name and first name, the second student's record should not be printed; instead the message: "I THINK THIS IS A DUPLICATE RECORD" should be printed. [edit]Deliverables main.cpp prog24Functions.h prog24Functions.cpp Sample data file: FirstName LastName CLASS ZIP AGE HomeTown GPA Hailee Ferrel FR 72275 20 Layton 3.63 Perry Caldwell-Reed SO 4164 19 Racine 2.96 Andrew Dawson JR 39123 21 Huntington 2.29 William Senser SR 15886 25 Fontana 2.14 Shelby Santiago FR 57021 23 Winter 3.15 Matthew Brannon SO 54064 18 Santa 3.35 Christopher Kou JR 31907 22 Monroe 2.36 Cassidy Monjaras SR 41928 24 Jefferson 2.13 Lauren Shah FR 65008 23 Visalia 2.66 Jonathan Quintanilla SO 79343 16 Howell 3.69 Andrew Chen JR 86176 18 Brownsville 3.32 Brendel Unruh SR 37743 20 Lansing 2.48 Christopher Royse FR 8095 22 Anchorage 3.98 Jose Harrison SO 33128 17 Greenville 2.09 Alexander Seiford JR 96517 16 Greenville 2.88 Quinton Johnson SR 56102 20 Winston 3.89 Tristan Gardner FR 74489 21 Brighton 2.22 Alexander Motz SO 49195 24 Cathedral 3.13 Molly Atkins JR 27698 15 Des 3.54 William Savells SR 17951 19 Shreveport 3.16 Shawn Wilcoxen FR 86284 21 Syracuse 3.11 Austin Hardy SO 73491 15 Birmingham 2.52 Jason Ammons JR 94515 22 Atlanta 2.86 Phillip Dutta SR 19503 19 Milwaukee 2.34 Wesley Elliott FR 8885 17 Eugene 2.64 Alexander Childers SO 55503 17 Thornton 2.76 Cameron Jones JR 77131 20 New 2.56 Jessica Louis SR 66868 24 Asheville 3.41 Ryan Kliphon FR 6054 16 Kissimmee 3.26 Zachariah Qureshi SO 18845 19 Harlingen 2.65 Ryan Cadenas JR 35181 16 Olathe 3.45 Chandrima Bryant SR 64898 18 Chicago 3.74 Doraliz Hansen FR 30588 23 Boston 2.61 Alonso Greer SO 94115 20 Victorville 3.19 David Llamas JR 84133 19 Hesperia 2.54 Caleb Dylag SR 35101 15 Sebastian 3.91 Rachel Zust FR 42196 16 Westminster 2.74 Tyler DeRosa SO 14421 19 Westminster 3.21 Kendall Sedate JR 43036 22 Moreno 2.29 Matthew Ortiz-Vitali SR 14801 22 Cary 2.03 Ryan Al-Nimri FR 53238 16 Mission 3.75 Daniel Dratz SO 59534 22 Mission 2.83 Weston Gage JR 56011 18 Macon 2.43 Asad Riggins SR 67131 25 Macon 2.06 John Thompson FR 15386 21 Olympia 3.82 James Seunsom SO 42143 21 Richmond 3.58 Corbin Bodden JR 32787 16 Provo 2.96 Allison Veselka SR 99047 21 Wilmington 3.35 Shawn Renton FR 74027 24 Fort 2.21 Michael Martin SO 74146 16 Bryan 2.82 Austin Huizinga JR 49494 15 Leominster 3.35 Caleb Berkovsky SR 3711 24 Leominster 3.51 Taylor Brown FR 69305 24 Kailua 2.18
  • 2. Elizabeth Taylor SO 54950 17 Tempe 2.95 Alexandra Itskin JR 35943 16 Denver 3.12 Reagan Zipoy SR 3892 16 Pomona 2.70 Edgar Leblanc FR 52703 22 Riverside 3.12 Brian Stevens SO 93293 23 Nashua 3.26 Sam Pearson JR 69161 17 Danbury 3.14 Colin Peterson SR 77027 24 Gulfport-Biloxi 2.72 Diana Sharpe FR 65253 22 Palmdale 3.35 Ching-Jung Labrada SO 48635 20 Aberdeen 3.93 Roberto Haddad JR 69486 19 Escondido 2.70 Mahlet Shifflet SR 82554 15 Appleton 3.32 Parker Miller FR 93219 20 South 2.32 Matthew Leake SO 49468 19 Mesa 3.55 Corey McBrayer JR 71592 18 Santa 2.45 David Tramontano SR 38229 24 Murrieta 3.51 John Rundquist FR 78321 16 Clarke 2.42 Caroline Christenberry SO 42590 24 Poughkeepsie 3.04 Ashley Thomas JR 86691 17 Louisville 2.95 Kyle Andras SR 43291 25 Bakersfield 2.62 Trey Bolling FR 74843 16 Muskegon 3.79 Adam Brown SO 76537 21 Fort 3.89 Michael Handley JR 58339 19 Lancaster 2.29 Andrew Zinah SR 88135 22 Odessa 3.55 Shawn Wilcoxen FR 86284 21 Syracuse 3.11 Austin Hardy SO 73491 15 Birmingham 2.52 Jason Ammons JR 94515 22 Atlanta 2.86 Phillip Dutta SR 19503 19 Milwaukee 2.34 Wesley Elliott FR 8885 17 Eugene 2.64 Phillip Dutta SR 19503 19 Milwaukee 2.34 Wesley Elliott FR 8885 17 Eugene 2.64 Diana Sharpe FR 65253 22 Palmdale 3.35 Diana Sharpe FR 65253 22 Palmdale 3.35 Diana Sharpe FR 65253 22 Palmdale 3.35 Sample Output: First Name Last Name Class Zip Age HomeTown GPA Matthew Ortiz-Vitali SR 14801 22 Cary 2.03 Asad Riggins SR 67131 25 Macon 2.06 Jose Harrison SO 33128 17 Greenville 2.09 Cassidy Monjaras SR 41928 24 Jefferson 2.13 William Senser SR 15886 25 Fontana 2.14 Taylor Brown FR 69305 24 Kailua 2.18 Shawn Renton FR 74027 24 Fort 2.21 Tristan Gardner FR 74489 21 Brighton 2.22 Andrew Dawson JR 39123 21 Huntington 2.29 Michael Handley JR 58339 19 Lancaster 2.29 Kendall Sedate JR 43036 22 Moreno 2.29 Parker Miller FR 93219 20 South 2.32 Phillip Dutta SR 19503 19 Milwaukee 2.34 I THINK THIS IS A DUPLICATE RECORD I THINK THIS IS A DUPLICATE RECORD Christopher Kou JR 31907 22 Monroe 2.36 John Rundquist FR 78321 16 Clarke 2.42 Weston Gage JR 56011 18 Macon 2.43 Corey McBrayer JR 71592 18 Santa 2.45 Brendel Unruh SR 37743 20 Lansing 2.48 Austin Hardy SO 73491 15 Birmingham 2.52 I THINK THIS IS A DUPLICATE RECORD David Llamas JR 84133 19 Hesperia 2.54 Cameron Jones JR 77131 20 New 2.56 Doraliz Hansen FR 30588 23 Boston 2.61 Kyle Andras SR 43291 25 Bakersfield 2.62 Wesley Elliott FR 8885 17 Eugene 2.64 I THINK THIS IS A DUPLICATE RECORD I THINK THIS IS A DUPLICATE RECORD Zachariah Qureshi SO 18845 19 Harlingen 2.65 Lauren Shah FR 65008 23 Visalia 2.66 Roberto Haddad JR 69486 19 Escondido 2.70 Reagan Zipoy SR 3892 16 Pomona 2.70 Colin Peterson SR 77027 24 Gulfport-Biloxi 2.72 Rachel Zust FR 42196 16 Westminster 2.74 Alexander Childers SO 55503 17 Thornton 2.76 Michael Martin SO 74146 16 Bryan 2.82 Daniel Dratz SO 59534 22 Mission 2.83 Jason Ammons JR 94515 22 Atlanta 2.86 I THINK THIS IS A DUPLICATE RECORD Alexander Seiford JR 96517 16 Greenville 2.88 Ashley Thomas JR 86691 17 Louisville 2.95 Elizabeth Taylor SO 54950 17 Tempe 2.95 Corbin
  • 3. Bodden JR 32787 16 Provo 2.96 Perry Caldwell-Reed SO 4164 19 Racine 2.96 Caroline Christenberry SO 42590 24 Poughkeepsie 3.04 Shawn Wilcoxen FR 86284 21 Syracuse 3.11 I THINK THIS IS A DUPLICATE RECORD Edgar Leblanc FR 52703 22 Riverside 3.12 Alexandra Itskin JR 35943 16 Denver 3.12 Alexander Motz SO 49195 24 Cathedral 3.13 Sam Pearson JR 69161 17 Danbury 3.14 Shelby Santiago FR 57021 23 Winter 3.15 William Savells SR 17951 19 Shreveport 3.16 Alonso Greer SO 94115 20 Victorville 3.19 Tyler DeRosa SO 14421 19 Westminster 3.21 Ryan Kliphon FR 6054 16 Kissimmee 3.26 Brian Stevens SO 93293 23 Nashua 3.26 Andrew Chen JR 86176 18 Brownsville 3.32 Mahlet Shifflet SR 82554 15 Appleton 3.32 Diana Sharpe FR 65253 22 Palmdale 3.35 I THINK THIS IS A DUPLICATE RECORD I THINK THIS IS A DUPLICATE RECORD I THINK THIS IS A DUPLICATE RECORD Austin Huizinga JR 49494 15 Leominster 3.35 Matthew Brannon SO 54064 18 Santa 3.35 Allison Veselka SR 99047 21 Wilmington 3.35 Jessica Louis SR 66868 24 Asheville 3.41 Ryan Cadenas JR 35181 16 Olathe 3.45 Caleb Berkovsky SR 3711 24 Leominster 3.51 David Tramontano SR 38229 24 Murrieta 3.51 Molly Atkins JR 27698 15 Des 3.54 Matthew Leake SO 49468 19 Mesa 3.55 Andrew Zinah SR 88135 22 Odessa 3.55 James Seunsom SO 42143 21 Richmond 3.58 Hailee Ferrel FR 72275 20 Layton 3.63 Jonathan Quintanilla SO 79343 16 Howell 3.69 Chandrima Bryant SR 64898 18 Chicago 3.74 Ryan Al-Nimri FR 53238 16 Mission 3.75 Trey Bolling FR 74843 16 Muskegon 3.79 John Thompson FR 15386 21 Olympia 3.82 Adam Brown SO 76537 21 Fort 3.89 Quinton Johnson SR 56102 20 Winston 3.89 Caleb Dylag SR 35101 15 Sebastian 3.91 Ching-Jung Labrada SO 48635 20 Aberdeen 3.93 Christopher Royse FR 8095 22 Anchorage 3.98 Solution #include #include using namespace std; //student class to capture students data class Student { //instance c=variables for students public: string fname; string lname;
  • 4. string classs; int zip; int age; string town; float gpa; //constructor Student(string fn,string ln,string c,int z,int a,string h,float g) { fname=fn; lname=ln; classs=c; zip=z; age=a; town=h; gpa=g; } //default constructor Student() { } }; //function to read data frm file //returns no of records read int readFromFile(Student students[100]) { int size=0; string fname,lname,town,classs; int zip,age; float gpa; ifstream myfile ("stDATA.txt"); if (myfile.is_open()) {
  • 5. getline(myfile,fname); while ( myfile>>fname ) { myfile>>lname; myfile>>classs; myfile>>zip; myfile>>age; myfile>>town; myfile>>gpa; students[size]=Student(fname,lname,classs,zip,age,town,gpa); size++; } myfile.close(); } else cout << "Unable to open file"; return size; } //display student read void display(Student students[],int size) { cout<<" NamettCLASSt ZIPt AGEt HomeTownt GPA"; for(int i=0;i students[j].gpa) { tmp = students[i]; students[i] = students[j]; students[j] = tmp; } //if students gpa match,then compare classifictaion else if(students[i].gpa==students[j].gpa) { if(students[i].classs >students[j].classs) { tmp = students[i]; students[i] = students[j];
  • 6. students[j] = tmp; } //if students gpa and classfictaion match, compare lname else if(students[i].classs == students[j].classs) { if(students[i].lname >students[j].lname) { tmp = students[i]; students[i] = students[j]; students[j] = tmp; } // f students gpa and classfictaion and lname match, compare fname else if(students[i].lname == students[j].lname) { if(students[i].fname >students[j].fname) { tmp = students[i]; students[i] = students[j]; students[j] = tmp; } // if students gpa and classfictaion and lname and fname match it emans it's a duplkictae record //set a flag to identify it else if(students[i].fname ==students[j].fname) { students[j].fname="Duplicate"; } } } } }
  • 7. } //sort } //main fucntion which triggers int main() { Student students[100]; int size=readFromFile(students); sort(students,size); display(students,size); cout<