


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Project; Class: Introduction to Computing Using MATLAB; Subject: Computer Science; University: Cornell University; Term: Spring 2008;
Typology: Study Guides, Projects, Research
1 / 4
This page cannot be seen from the preview
Don't miss anything!



The coded items below (e.g., c1e, s2a) indicate what a student’s solution should accomplish. Codes that begin with the letter ‘c’ deals with correctness; codes that begin with ‘s’ deals with style. Grader : If a student’s solution does not accomplish task c1a, for example, then write the task code ‘c1a’ along with any diagnostic remarks you can give. Count the number of correctness and style errors separately. Items marked with ** count as two errors. In the table below, the top row lists the possible scores (1 to 5). The next row lists the number of correctness errors corresponding to every score category. The style score is determined similarly. Enter the total score (maximum of 10) in CMS as the project score. If there are bonus questions, enter any bonus points separately in the “Bonus Bucket,” separate from the project score. Student : Read the grading guide for every project, even if you get a perfect score! Notice from the table below that we often give one or two “freebies,” i.e., mistakes that don’t cost you any points. Learn from working on the project, and learn from any mistakes.
c and s stand for correctness and style; see table below parts with ** next to them means that they are double the value, *** for triple, etc. Score 0 1 2 3 4 5 #correctness errors >10 7-10 5-6 3-4 2 0- #style errors—general >=3 2 0- s3a style score: 0, 1, 2, or 3 points
(s0a) Use meaningful variable names (s0b) Appropriate indentation (s0c) Appropriate comment header in each script/function file (s0d) Use semi-colons as needed; not for use after if condition or else keyword (s0e) Appropriate and concise comments throughout (s0f) Reasonable line lengths; no horizontal scrolling
Execute “ColorPicker” in the Matlab color window. Slide the “Red Component” slider-bar at the top of the GUI. The color slice should change as shown below:
c1a – Checks for bad input (0≤r≤1, 0≤m, 0≤n) c1b – Returns [] in the case of bad input c1c – Red component = r for every output pixel c1d – Green channel increases uniformly from 0 to 1 from top to bottom c2e – Blue channel increases uniformly from 0 to 1 from left to right c2f – Draws a clipped dot if we try to draw dot at edge of screen
Cut a small region and paste it close to the center of the image (so that the entire cut will lie within the image). Do the same thing with copy. Cut a region and paste it close to the edge of the image (so that the only part of the cut will lie within the image). Do the same thing with copy. Cut a region and paste it within the region itself Do the same thing with cut
c3a – Checks for bad input o Checks for all of the following bad cases ( x1 , y1 ) is not above and to the left of ( x2 , y2 ) ( x3 , y3 ) lies within the image c3b – The region cut from is replaced with white pixels (unless pasted back upon) c3c – The region copied from is untouched (unless pasted back upon) c3d – Properly handles cases in which the “copy from” and “copy to” region intersects c3e– Properly handles cases in which the “paste to” region lies partially off the image The students were told of the similarity between the CutPaste and CopyPaste functions. They were told to create a helper function that exploited this similarity. We award some style points here based on how well the student identified similar operations, and modularized the functions. s3a o 3 points – All shared code between CopyPaste and CutPaste is placed in helper function(s), and then called from both CopyPaste and CutPaste. The helper function has the bulk of the code, and CopyPaste and CutPaste are extremely short. o 2 points – The helper function(s) used computes a significant part of the shared operations of CopyPaste, and CutPaste. However, there is still some code duplication between the CopyPaste and CutPaste functions. o 1 point – The helper function(s) only take advantage of trivial similarities between CutPaste and CopyPaste. The bulk of the code is still within the CutPaste and CopyPaste functions. o 0 point – There is no helper function.