Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are given a list of students with their ID , name, and score in student.csv file. Your task is to get the student
You are given a list of students with their ID name, and score in "student.csv file. Your task is to get the student data from the file. Next, sort the students by their scores in ascending order and display the sorted list. In cases of identical scores, sort students alphabetically by their names.
Data Representation:
Construct a structure named StructStudentInfo, encompassing the following members:
StudentName
ID
Score
Functionalities:
a SortByScore Function:
Input: The structure array studentsArray and the number of students
Functionality: Sorts the students based on their scores. For students with the same score, an alphabetical order based on names should be considered.
Output: A modified structure array with students sorted as per the criteria.
b Display Function:
Input: The sorted structure array.
Functionality: Outputs the sorted list of students.
Output: Display student names, IDs, and scores.
Sample content of student.csv file:
Name, Student id Score
John Doe,
Bruce Wayne,
Bon Jovi,
Ada Lovelace,
Charles Babbage,
Constraints Student Name o can consists of uppercase and lowercase letters. o contains space character to separate first name and last name. o the number of characters will not exceed Output Format Print exactly n lines. Each line should display the students name, ID and score separated by space character. the score should have exactly digits after decimal point.
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