Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question

Write C++ program that will read student records from a data file and sort the contents.
Declare a class to describe a student record with private fields for:

  • first name
  • last name
  • student id
  • declared major
  • grade point average
  • date of birth

Use appropriate data types, constructor(s), and accessor methods.
Do not hard-code values. The comma-separated value (CSV) text data file students.csv is provided for development and testing. Other data files may also be used. These will have the same fields with an arbitrary number of records.
After the file is read, and the data stored in memory, write a message to the console indicating how many records were read.

  •  xx records read.

Prompt the user to select the sort criterion field

  • Sort by: (L)ast name, (S)tudent Id, (M)ajor, (G)PA, (A)ge, or (Quit)

Read the single-character user selection.

Sort the data records using a selection sort method. Print the sorted data records to the console using a toString() method from the class that you created.

After the last records are printed, repeat the user menu selections and loop until the user selects 'Q' to quit the application.

Do not use any global variables.

Alice, Johnson, 12345, Computer Science, 3.7,5-Jan-99
Bob, Smith, 23456, Electrical Engineering, 3.5,18-Feb-90
Charlie, Brown, 34567, Psychology, 3.2, 23-Mar-95
David, Lee,45678, Physics, 3.9, 12-Apr-93
Emma, Miller, 56789, English Literature, 3.6,7-May-90
Frank, Anderson, 67890, History, 3.1,29-Jun-91
Grace, Clark, 78901, Mathematics, 3.8, 14-Jul-92
Hannah, Wilson, 89012, Biology, 3.4, 30-Aug-93
Isaac, Wright, 90123, Chemistry, 3.9,11-Sep-99
James, Moore, 12346, Computer Science, 3.7,3-Oct-94
Katherine, Lewis, 23457, Electrical Engineering, 3.5, 22-Nov-97
Liam, Young, 34568, Psychology, 3.2,15-Dec-89
Mia, Hall,45679, Physics, 3.9,19-Jan-98
Noah, Turner, 56790, English Literature, 3.6,8-Feb-96
Olivia, White, 67891, History, 3.1,27-Mar-87
Penelope, Adams, 78902, Mathematics, 3.8,6-Apr-92
Quinn, Thomas, 89013, Biology, 3.4, 25-May-94
Ryan, Baker, 90124, Chemistry, 3.9,10-Jun-97
Sophia, Harris, 12347, Computer Science, 3.7,2-Jul-89
Thomas, King, 23458, Electrical Engineering, 3.5, 14-Aug-95
Uma, Scott, 34569, Psychology, 3.2,9-Sep-88
Vincent, Green, 45680, Physics, 3.9, 28-Oct-96
expand button
Transcribed Image Text:Alice, Johnson, 12345, Computer Science, 3.7,5-Jan-99 Bob, Smith, 23456, Electrical Engineering, 3.5,18-Feb-90 Charlie, Brown, 34567, Psychology, 3.2, 23-Mar-95 David, Lee,45678, Physics, 3.9, 12-Apr-93 Emma, Miller, 56789, English Literature, 3.6,7-May-90 Frank, Anderson, 67890, History, 3.1,29-Jun-91 Grace, Clark, 78901, Mathematics, 3.8, 14-Jul-92 Hannah, Wilson, 89012, Biology, 3.4, 30-Aug-93 Isaac, Wright, 90123, Chemistry, 3.9,11-Sep-99 James, Moore, 12346, Computer Science, 3.7,3-Oct-94 Katherine, Lewis, 23457, Electrical Engineering, 3.5, 22-Nov-97 Liam, Young, 34568, Psychology, 3.2,15-Dec-89 Mia, Hall,45679, Physics, 3.9,19-Jan-98 Noah, Turner, 56790, English Literature, 3.6,8-Feb-96 Olivia, White, 67891, History, 3.1,27-Mar-87 Penelope, Adams, 78902, Mathematics, 3.8,6-Apr-92 Quinn, Thomas, 89013, Biology, 3.4, 25-May-94 Ryan, Baker, 90124, Chemistry, 3.9,10-Jun-97 Sophia, Harris, 12347, Computer Science, 3.7,2-Jul-89 Thomas, King, 23458, Electrical Engineering, 3.5, 14-Aug-95 Uma, Scott, 34569, Psychology, 3.2,9-Sep-88 Vincent, Green, 45680, Physics, 3.9, 28-Oct-96
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education