Starting from:

$20

CMSC216- Project 1 Solved

Overview

For this project you will write a C program that reads assignment scores and computes numeric grades and statistical information.    

 

1.1        Debugging Guidelines

Make sure you are familiar with the information provided at http://www.cs.umd.edu/~nelson/classes/resources/cdebugging/

1.2        Obtaining project files

To obtain the project files, copy the folder project1 available in the 216 public directory to your 216 directory.

You need to copy the project1 folder we have provided as it has a file (.submit) that will allow you to submit your project. Notice that the project description can be found in the project descriptions directory.

2          Specifications

2.1        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

2, 82, 40,                                                                                                                                     1

3, 73, 10,                                                                                                                                     3

4, 84, 10,Mean: 65.0000, Standard Deviation: 18.2346                                            3

 

Regarding the data and processing:

1.        Use double as your floating-type (e.g., double tmp, double numeric score).

2.        The assignment number will be a value between 1 and the maximum number of assignments. You can assume valid assignment numbers are provided.

3.        Assignments can be provided in any order; however they must be printed in order (by assignment number).

4.        An assignment score will be an integer value between 0 (inclusive) and 100 (inclusive). You can assume we will provide valid scores.

5.        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.

6.        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.

7.        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.

8.        If any assignment is dropped, the sum of assignment weights will, nearly always, not correspond to a

100.

9.        Either ’Y’ or ’y’ will request statistical information. Any other character will indicate that no statistical information will be generated.

10.    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.

11.    Points penalty per day late will be an integer value.

4.3      Functions Requirements

1.    You must have at least two other functions in addition to main.

2.    One of your functions must take at least one array as a parameter.

4.4    Other

1.    Use %5.4f as the format for a float.

2.    The maximum number of assignments in the input is 50.

3.    IMPORTANT: You may not use the following C constructs. If you do you will lose significant credit. a. C structures.

b.       Global variables.

c.        Two-dimensional (2D) arrays.

d.       An array of pointers to arrays. We consider them 2D arrays.

e.       Dynamic memory allocation (e.g., malloc, calloc).

4.    To use the sqrt function or any function from the math library you need to include the file <math.h and compile with the -lm option (e.g., gcc grades.c -lm). You can find additional information about the math library by using the linux man pages (“man sqrt” on grace).

5.    You must name your C file grades.c otherwise it will not compile on the submit server.

6.    You may not use the qsort function.

7.    If you decide to use the indent tool make sure you define the appropriate alias as specified in the indent utility info.txt file that can be found in the grace info folder.

8.    You need to use #define (e.g., instead of 50 use #define to define a symbolic constant).

9.    A standard deviation calculator can be found at:

http://www.mathsisfun.com/data/standard-deviation-calculator.html

4.5        Compilation

Make sure your gcc alias has been set as defined at http://www.cs.umd.edu/~nelson/classes/resources/setting_gcc_alias.shtml

4.6        Execution

We will use input and output redirection in order to execute your program. For example, assuming data is present in the public01.in file, we will run your program as follows: a.out < public01.in. You can compare the results of your program against expected results by using the diff command. Information about the diff command can be found at http://www.cs.umd.edu/~nelson/classes/resources/cdebugging/diff/. Make sure you remove output files created while using output redirection. If your code has bugs (e.g., infinite loop) you may create large files that impact grace’s quota.    

 

1.       Use braces; avoid loops and conditionals without them.

6          Testing

Make sure you test your code with different input data sets (sets different from the ones we have provided as public input). You can take one of the provided input files (e.g., public01.in), update it with different values, and use input redirection to generate output. Notice you will need to manually check your results (you may not compare your results with the results of another student’s code). To come up with test cases read the project description carefully. It is best if you think of test cases as you implement your project.

7          Submission

7.1        Deliverables

For this project, the only file that we will grade is grades.c (which must be the name of your source file).

7.2        Procedure

You can submit your project by executing, in your project directory (project1), the submit command. This will prompt you for your UMD Directory ID and password, and if all goes well, inform you of a successful submission. You should then log onto the submit server (there is a link on the course website) and check your public test results to be sure that things worked as you expected.

You need to execute submit in the project1 directory, as we gave you a .submit file that allows you to submit. If you did not copy the project1 folder we have provided, you will not be able to submit (you will be missing the necessary .submit file).

Immediately after copying the project1 folder, try to submit your project (even if you have not started). Do not wait until the day the project is due in order to try the submission process.

7.3        Possible problem with submit command

If you try to submit your project in grace, and you get the error:

”Exception in thread ’main’ java.lang.OutOfMemoryError: unable to create new native thread” then close all terminals windows except one, and try to submit again.

More products