Write a C program to implement the following requirement: Input: The program will read from the standard input: - On the

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Write a C program to implement the following requirement: Input: The program will read from the standard input: - On the

Post by answerhappygod »

Write A C Program To Implement The Following Requirement Input The Program Will Read From The Standard Input On The 1
Write A C Program To Implement The Following Requirement Input The Program Will Read From The Standard Input On The 1 (49.88 KiB) Viewed 25 times
Write a C program to implement the following requirement: Input: The program will read from the standard input: - On the first line, an integer n (n > 0). - On the next n lines, each line will contain 4 pieces of information (separated by a single comma",") of a student: - Student ID (String) - First name (String) - Last name (String) - Grade (Float) Output: The program will print out the list of sorted students based on their grades from highest to lowest. If two student have the same grade, student with smaller ID will appear first. For each student, print out their Student ID, First Name, Last Name, and Grade (2 decimal places float number) separated by a single comma Requirements: Use the following struct to store the student information: struct STUDENT { char student ID [7]; char *firstName; char *lastName; float grade; } You MUST use pointer to do the sorting. If you don't use pointer, you will get 0. SAMPLE INPUT 1 100200, Elon, Musk, 3.25 123456, John, Oliver, 4.00 2 SAMPLE OUTPUT 1 123456, John, Oliver, 4.00 100200, Elon, Musk, 3.25 3 SAMPLE INPUT 2 678900, Mark, Henry, 4.00 100200, Elon Musk, 3.75 123456, John, Oliver, 4.00 SAMPLE OUTPUT 2 123456, John, Oliver, 4.00 678900, Mark, Henry, 4.00 100200, Elon, Musk, 3.75
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply