Description
For this project you will write a C program that reads assignment scores and computes numeric grades and statistical information.
Objectives
To practice functions and arrays.
Specifications
- Input Data
Your project will read information about class assignments and compute a numeric score. The data provided consists of:
- Number of assignments
- Points penalty per day late
- Number of assignments to drop
- Whether statistical information will be generated
- Assignments information (assignment number, score, weight, days late).
The data format is:
Points_Penalty_Per_Day_Late Drop_N_Lower_Value_Assignments Stats_Y/N
Number_of_Assignments(n)
Assignment Info #1
Assignment Info #2 …
Assignment Info #n
Each assignment info entry has the following information: assignment’s number, assignment’s score, assignment’s weight (percentage), days late (integer). The following is an example of the data your program will process:
10 2 Y
4
2, 82, 40, 1
1, 91, 40, 0
4, 84, 10, 3
3, 73, 10, 3
For the above data, there is a 10 points penalty per day late, the 2 lower scores need to be dropped, statistical information will be generated (Y), and a total of four assignments are provided. For assignment number 2 the student’s score is 82, the assignment represents 40% of the student’s grade and it was submitted 1 day late.
4.2 Processing
Your program will compute the numeric score after dropping the n lowest scoring assignments and taking into account days late, penalty per day late, and the weight associated with the assignments. If statistical information is requested, the mean and standard deviation will be computed. For example, for the above data, your program is expected to generate the following output:
Numeric Score: 81.5000
Points Penalty Per Day Late: 10 Number of Assignments Dropped: 2 Values Provided:
Assignment, Score, Weight, Days Late
1, 91, 40, 0
4, 84, 10,Mean: 65.0000, Standard Deviation: 18.2346 3
Regarding the data and processing:
- Use double as your floating-type (e.g., double tmp, double numeric score).
- The assignment number will be a value between 1 and the maximum number of assignments. You can assume valid assignment numbers are provided.
- Assignments can be provided in any order; however they must be printed in order (by assignment number).
- An assignment score will be an integer value between 0 (inclusive) and 100 (inclusive). You can assume we will provide valid scores.
- The weight will be an integer value between 0 (inclusive) and 100 (inclusive). You need to check the that sum of weights for all assignments add to a 100. If after reading the data the total weights do not add to a 100, your program will generate the error message ERROR: Invalid values provided and the program will terminate. The message should be printed on a line by itself.
- Your program should remove the n lowest valued assignments before performing any numeric score computation. We define value as an assignment’s score × the assignment’s weight. For a total of x assignments, we will provide a value of assignments to drop that is in the inclusive range (0 .. x – 1). Notice that number of days late and the penalty per day WILL NOT be used in order to decide what assignment to drop. If two assignments have the same value (score × weight) the one with the lowest assignment number will be dropped.
- The numeric score will be a value between 0 (inclusive) and a 100 (inclusive). For the numeric grade computation, adjust the score for an assignment based on the number of days late and the points penalty per day late. An assignment score will be set to 0 if the assignment’s score becomes less than 0 after the late penalty is applied. This adjusted score along with the assignment’s weight will allow you to compute the numeric score.
- If any assignment is dropped, the sum of assignment weights will, nearly always, not correspond to a
100.
- Either ’Y’ or ’y’ will request statistical information. Any other character will indicate that no statistical information will be generated.
- For the computation of the mean and standard deviation you need to apply the late penalty, but do not drop any assignments (even if there was a assignment drop request). In addition, do not use weights for the computation of mean and standard deviation.
- Points penalty per day late will be an integer value.
4.3 Functions Requirements
- You must have at least two other functions in addition to main.
- One of your functions must take at least one array as a parameter.





