SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Stuart Reges, Marty Stepp
Chapter:
Searching And Sorting
Exercise:
Programming Projects
Question:3 | ISBN:9780136091813 | Edition: 2

Question

Write a program that processes a data file of students’ course grade data. The data arrive in random order; each line stores information about a student’s last name, first name, student ID number, grade as a percentage, and letter grade. For example, here are a few lines of data:
Smith Kelly 438975 98.6 A
Johnson Gus 210498 72.4 C
Reges Stu 098736 88.2 B
Smith Marty 346282 84.1 B
Reges Abe 298575 78.3 C
Your program should be able to sort the data by any of the columns. Use Comparators to achieve the sort orderings. Make the data sortable by last name, student ID, and grade percentage in ascending and descending order. For example, here are the lines of student data sorted a few different ways:
Student data, by last name:
Johnson Gus 210498 72.4 C
Reges Stu 098736 88.2 B
Reges Abe 298575 78.3 C
Smith Kelly 438975 98.6 A
Smith Marty 346282 84.1 B
Student data, by student ID:
Reges Stu 098736 88.2 B
Johnson Gus 210498 72.4 C
Reges Abe 298575 78.3 C
Smith Marty 346282 84.1 B
Smith Kelly 438975 98.6 A

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Sorry the answer is not available at the moment…

If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.

Spread the 'tradition of sharing'.