Question: Question: Multithreaded Student Grade Analysis System with Semaphores Design a multithreaded program that processes student grades stored in an input file. The program should calculate

Question: Multithreaded Student Grade Analysis System with Semaphores Design a multithreaded program that processes student grades stored in an input file. The program should calculate each student's average grade, determine if they passed or failed, and write the results to an output file. Additionally, it should compute global statistics, such as the number of students passing each question, the highest and lowest grades, and the total number of students passing overall. You will use semaphores for thread synchronization and perform file reading and writing operations.
Example: 10174.50 Passed 10247.50 Failed 10391.25 Passed --- Overall Statistics --- Number of students passing each question: Question 1: 2 students passed. Question 2: 3 students passed. Question 3: 2 students passed. Question 4: 1 students passed. Total number of students who passed overall: 2 Highest grade: 95 Lowest grade: 303. Implementation Details Use threads to process each student's grades in parallel. Using a Semaphore, statistics such as the highest/lowest grade, the number of passing students, and similar values need to be updated safely. Dynamically allocate memory based on the input file. 4. Tasks: Parse the input file to read N (number of students) and M (number of grades per student). Compute for each student: Average grade. Pass/fail status (pass if average >=60). Update global statistics: Number of students passing each question. Highest and lowest grades. Total students passing. Write results and global statistics to the output file.
Example:
10174.50 Passed
10247.50 Failed
10391.25 Passed
--- Overall Statistics ---
Number of students passing each question:
Question 1: 2 students passed.
Question 2: 3 students passed.
Question 3: 2 students passed.
Question 4: 1 students passed.
Total number of students who passed overall: 2
Highest grade: 95
Lowest grade: 30
Question: Multithreaded Student Grade Analysis

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!