PRELAB #5 RUBRIC 1.) Use your best judgement for all of these. This is quite subjective, though there are specific things I'm looking for. 1.a.) Full credit if they mention that it has to do with breaking down software into smaller pieces. 1.b.) Full credit if they mention that it has something to do with hiding internal details of code. 1.c.) Full credit if they mention that it has something to do with taking the same code and applying it to a different problem or to multiple problems. 2.) Full credit: Tells the compiler that a function exists. (or similar) Full credit: Needed if we call a function before it is defined. (or similar) 2 points if they only describe what it is or only give an example. 3.) double process( int ) OR double process( int variableName ) Guideline: -1 pt: return type is correctly shown -1 pt: name is in the correct place -1 pt: parameter is in the correct place -Take of one point if the syntax is wrong but everything else looks ok (for a total of 2 points) -It's still ok if they didn't put a semicolon at the end 4.) There are a wide variety of answers. The general form of this is: -2.0 + ( (double)rand() / RAND_MAX ) * ( 2.0 - ( -2.0 ) ) Guidelines: -1 pt: Call to rand() -1 pt: Division by RAND_MAX -1 pt: double division is used for the division -Multiple ways to do this; something needed to be casted to a double -If they didn't use division at all then no credit for this portion -1 pt: Addition by -2.0 or subtraction of 2.0 -Only 1/2 of a point if they used integers -Multiplication by something equivalent to ( 2.0 - ( -2.0 ) ) -Only 1/2 of a point if they used integers -If there is an answer that gets an evenly distributed random double between -2.0 and 2.0 that doesn't follow these guidelines, still award full credit 5.a.) fopen( "file.txt", "r" ) Guidelines: -1 pt: fopen is used -1/2 pt per correct parameter 5.b.) NULL 1/2 pt if they said 0 5.c.) There are a WIDE variety of answers, and these are further complicated by the optional bonuses. I believe that most students tried to get all the bonuses. -1 pt: Variables are declared -1 pt: Variables are of the correct types -1 pt: fopen is used -1 pt: first parameter to fopen is filename -if fopen isn't used, no credit -1 pt: second parameter to fopen is "r" (or something equivalent) -if fopen isn't used, no credit -1 pt: fscanf is used to read in the integer -1 pt: first parameter of fscanf is whatever the file pointer is -if fscanf isn't used, no credit -1 pt: second parameter of fscanf is "%i" or "%d" (or something equivalent) -if fscanf isn't used, no credit -1 pt: third parameter of fscanf is a pointer to a valid int variable -if fscanf isn't used, no credit -1 pt: fclose is used -1 pt: parameter to fclose is whatever the file pointer is -if fclose isn't used, no credit -1 pt: under all circumstances, fclose ends up being called if the file was opened correctly -1 pt: the integer read in is returned (assuming it's not an error return value for a bonus) -1 pt: the whole thing is a function definition, as opposed to just some block of code (i.e. int foo() { return 5; } as opposed to just return 5;) BONUSES: -For each bonus, +1 point if they clearly made an attempt but it doesn't work right. +2 points of it works correctly.