Question
I am working on a project in C++ as shown above that will read from a csv file that contains Student Name, Student number, GPA.
I am working on a project in C++ as shown above that will read from a csv file that contains Student Name, Student number, GPA.
The csv file contains:
Abraham Simpson,324543,3.9 Agnes Skinner,470546,4.0 Akira Kurosawa,411928,2.1 Alice Glick,459608,3.3 Allison Taylor,747954,2.3 Apu Nahasapeemapetilon,290816,4.0 Artie Ziff,245446,3.6 Baby Gerald,155387,3.9 Barney Gumble,262592,1.7 Bart Simpson,753102,1.8 Bernice Hibbert,242653,3.9 Brandine Spuckler,584416,1.7 Bumblebee Man,603577,3.1 Carl Carlson,241968,3.0 Chazz Busby,362030,3.7 Cletus Spuckler,653783,2.9 Comic Book Guy,234272,3.7 Dewey Largo,910346,2.5 Disco Stu,736389,4.0 Dolph Starbeam,829982,3.9 Drederick Tatum,937537,2.3 Edna Krabappel,877842,1.6 Elizabeth Hoover,389470,3.5 Gil Gunderson,383513,1.7 Gloria Jailbird,601956,3.2 Groundskeeper Willie,774965,2.8 Hans Moleman,217944,2.3 Helen Lovejoy,686009,1.8 Herman Hermann,164996,2.2 Homer Simpson,413084,2.1 Jacqueline Bouvier,522856,2.3 Janey Powell,919159,2.2 Jasper Beardly,417008,3.6 Jessica Lovejoy,667331,1.9 Jimbo Jones,718588,3.6 Johnny Tightlips,840329,3.3 Judge Roy Snyder,533451,1.8 Kearney Zzyzwicz,758048,2.8 Kent Brockman,568727,1.7 Kirk Van Houten,695606,1.6 Krusty The Clown,901832,4.0 Kumiko Albertson,339422,3.5 Lenny Leonard,562762,2.6 Lindsey Naegle,570423,4.0 Ling Bouvier,249669,4.0 Lionel Hutz,212516,2.8 Lisa Simpson,693664,2.3 Luann Van Houten,737447,2.7 Luigi Risotto,757705,2.5 Lunchlady Doris,895470,3.0 Maggie Simpson,712478,3.1 Manjula Nahasapeemapetilon,236261,2.3 Marge Simpson,695580,3.1 Martin Prince,575687,2.3 Maude Flanders,272754,2.3 Mayor Joe Quimby,425163,3.0 Milhouse Van Houten,619711,2.9 Miss Springfield,855862,3.5 Moe Szyslak,219634,3.2 Mona Simpson,419417,3.4 Ned Flanders,746703,2.5 Nelson Muntz,584760,2.4 Old Jewish Man,259301,2.3 Patty Bouvier,544545,3.1 Rabbi Hyman Krustofsky,374366,3.5 Rainier Wolfcastle,674248,2.7 Ralph Wiggum,414067,3.5 Rod Flanders,823458,2.5 Roger Meyers Jr.,313590,2.1 Ruth Powers,231018,3.7 Sarah Wiggum,920562,2.3 Sea Captain,544294,3.7 Selma Bouvier,217994,3.8 Seymour Skinner,434336,1.7 Shauna Chalmers,828516,2.1 Sideshow Mel,799960,2.9 Snake Jailbird,950955,1.8 Squeaky-Voiced Teen,194002,1.8 Surly Duff,146127,3.4 The Rich Texan,300288,2.8 Todd Flanders,257297,2.3 Troy McClure,394769,1.9 Uter Zorker,712465,2.2 Waylon Smithers,387433,3.0 Wendell Borton,677806,1.7 Wise Guy,134681,1.8
It expects output to look as follows exactly:
Enter GPA query... ? @2.2 Syntax error: ? [Op][value]Op: [>,3.8 [1] 155387: 3.9 (Baby Gerald) [2] 242653: 3.9 (Bernice Hibbert) [3] 249669: 4.0 (Ling Bouvier) [4] 290816: 4.0 (Apu Nahasapeemapetilon) [5] 324543: 3.9 (Abraham Simpson) [6] 470546: 4.0 (Agnes Skinner) [7] 570423: 4.0 (Lindsey Naegle) [8] 736389: 4.0 (Disco Stu) [9] 829982: 3.9 (Dolph Starbeam) [10] 901832: 4.0 (Krusty The Clown) ? ~3.9 [1] 155387: 3.9 (Baby Gerald) [2] 242653: 3.9 (Bernice Hibbert) [3] 324543: 3.9 (Abraham Simpson) [4] 829982: 3.9 (Dolph Starbeam) ? ! Exit the program? (Y)es/(N)o: y Goodbye!
I have a few of the header and regular files made but I do not know how to do this at all. I know I need to create functions to search for GPA's then sort by student number ascending as well as number them. Can you help?
- A header file containing a structure for the GPA record of a student under the name "GPA.h": command line format: ? [operation][GPA Value] Examples: ? 3.9 [ENTER] list all the GPA records more than 3.9 ? 3.0 [ENTER] list all values close to 3.0 with 0.05 precision (between 2.95 and 3.05 ) ? ! End query Your program should work under a function called gpaQuery. gpaQuery bool gpaQuery(const char* filename); This function returns false if the filename can not be opened for reading, otherwise, it will return true. gpaQuery runs as follows: Using the above data The function should work as follows: Enter GPA query... ?@2.2 Syntax error: ? [Op][value ] ENTER> Op: [>,3.8 [1] 155387: 3.9 (Baby Gerald) [2] 242653: 3.9 (Bernice Hibbert) [3] 249669: 4.0 (Ling Bouvier) [4] 290816: 4.0 (Apu Nahasapeemapetilon) [5] 324543: 3.9 (Abraham Simpson) [6] 470546: 4.0 (Agnes Skinner) [7] 570423: 4.0 (Lindsey Naegle) [8] 736389: 4.0 (Disco Stu) [9] 829982: 3.9 (Dolph Starbeam) [10] 901832: 4.0 (Krusty The Clown) ? 3.9 [1] 155387: 3.9 (Baby Gerald) [2] 242653: 3.9 (Bernice Hibbert) [3] 324543: 3.9 (Abraham Simpson) [4] 829982: 3.9 (Dolph Starbeam) ? ! Exit the program? (Y)es/(N)o: y Goodbye! Modules Implement your program in three modules: - GPAlist: (must contain the gpaQuery function) - File: hold file-related functions - UI: holding User interaction functions. - Ul: holding User interaction functions. Tester program
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started