Array and Strings – Strings – Problem #9
IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive
Problem Statement
Write a C program to calculate the relative grades of 10 students. The steps to calculate the grade are given as follows: (a) Take the marks of the 10 students in an array marks[]. The maximum and minimum marks are 100 and 0 respectively. If the entered marks are outside the range, then error should be displayed, and the system will wait till you enter the marks within the range. (b) Calculate the average (μ) of the marks (c) Calculate the standard (σ) deviation of the marks (d) Hence calculate the relative grades of the marks using the category: 10 if the mark is above (μ + 1.5*σ) 9 if the mark is above (μ + 1.0*σ) 8 if the mark is above (μ + 0.5*σ) 7 if the mark is above (μ) 6 if the mark is above (μ - 0.5*σ) 5 if the mark is above (μ - 1.0*σ) 4 if the mark is above (μ - 1.5*σ) Your input should be the marks of 10 students within an array and your output should be the grades of each of the students based on the marks that you have inputted. You may print the grade of each student in a new line and additionally make the output more readable, for example, Grade of Student 1 = 9 Grade of Student 2 = 10 Grade of Student 3 = 7 and likewise. . . . . . .