Grading Guide for Assignment 5 You can download SavitchIn.java from "http://www.cs.cornell.edu/courses/cs100m/2004sp/Exercises/SavitchIn.java" ************************************************************************* UNIVERSAL STYLE/CORRECTESS POINTS (same for all problems) X represents problem # (We use 3 to represent Problem 2b) cXa: doesn't compile, or throw exceptions, or no submitted file, or only submit class file... sXa: redundant code; sXb: bad formatting for code style; sXc: no comments, or bad comments; sXd: no header; sXx: bad file name; sXy: bad formatting for output; sXz: using break in the loop; if they do it for every loops, treat it as one mistake ************************************************************************* Problem 1: Style s1e: does not use default value variables to assign default values s1f: illegal changes to method headers (except for reset methods) Correctness (grading explanation: Use the code below if they did something wrong for that specific method. The comment code summerize some common errors, you can put those code after the correctness code instead of typing your comments. For example: if the student makes a mistake in default constructor, where he/she set the variable type correctly, then u should put down c1b2. If he/she set the both the "value" and "type" correctly, you could put down c1b1_2. The comment code are just serve as the purpuse to save typing and let the students know exactly what they did wrong. but no matter how many comment codes they got for a single method, that just count as 1 correctness point.) Constructor c1b: default constructor (does not need to have one if the values are initiallized correclty) c1c: constructor with the parameter for value c1d: constructor with the parameter for type c1e: constructor with both parameters Reset methods: two style of reset methods are accepted - 1. reset with parameters 2.reset without parameter, which set the variables to default values. c1f: resetValue c1g: resetType c1h: reset Comparison c1i: compareTo c1j: isGreaterThan c1k: isLessThan Utilities c1l: round c1m: toString c1n: checkType Testing (Note that students will not necessarily use arrays, since we didn't cover them yet. Some people will do testing with user I/O, which is OK.) c1o: test all the methods and constructors c1p: test 0.0 C == 32.0 F c1q: test -40.0 C == 40.0 F c1r: test 100.0 C == 212.0 F c1s: getCelsius c1t: getFarenheit Comment code: 1: member variable "value" is not set correctly 2: member variable "type" is not set correctly/dodes not check whether the input is valid or not 3: return value is calculated incorrectly 4: does not round the result to nearest tenth digit ************************************************************************* Problem 2a: Note: Overall, if someone designed a more rigourous algorithm, that's OK style s2e: it should use some named constants (such as capacity of truck and bin) s2f: it should use only a Main Class and some static methods s2g: clear output format correctness: c2b: takeBoxesFromBin method or equivalent code should not take more boxes than that is left in the bin c2c: boxes put in the truck should not exceed truck capacity c2d: myRandom is written correctly c2e: condition for while loop is correct c2f: compute cycles correctly c2g: compute efficiency correctly c2h: every cycle spew boxes into the bin c2i: every cycle 3 workers try to take boxes from the bin (Note that many students are not counting cycles for Workers when there are no boxes in the bin. It's not what's in the assignment, but we're allowing this more sophisticated approach.) c2j: has output for boxes in truck c2k: has output for cycles ************************************************************************* Problem2b: c3z: NOT OOP STYLE! style s3e: should have at least Chute, Truck, Bin, Worker classes s3f: prompts message to user for input correctness c3b: takeBoxesFromBin method or equivalent code should not take more boxes than that is left in the bin c3c: boxes put in the truck should not exceed truck capacity c3d: condition for while loop is correct c3e: compute cycles correctly c3f: compute efficiency correctly c3g: every cycle spew boxes into the bin c3h: every cycle 3 workers try to take boxes from the bin (Note that many students are not counting cycles for Workers when there are no boxes in the bin. It's not what's in the assignment, but we're allowing this more sophisticated approach.) c3i: run simulation several times according to user's input c3j: every simulation output boxes in truck c3k: every simulation output cycles c3n: compute average number of boxes placed in the truck correctly c3o: compute minimum number of boxes placed in the truck correctly c3l: compute maximum number of boxes placed in the truck correctly c3m: compute average number of completed cycles correctly **************************************************************************************** Bonus: 5 bonus points, if use an array of workers instead of three individual variables. You can comment as "A5 use array" 5 bonus points, if use an optional command-line argument for the input number of simulations. You can comment as "A5 command-line argument" 25 bonus points, modify your program such that it outputs the data for all simulations in a data file. Provide a MATLAB program called analysis.m that calls your Java program, reads in the data file that Problem2b generates, and plots it in a meaningful and descriptive way. YOu can comment as "A5 analysis" (Suggestion: 5 points for java program write data file correctly, 5 points for matlab program call java program correctly 5 points for read in data correctly 5 points for plot correctly 5 points for title, legend, and labels) (1) Problem 1 Correctness: 2 points _________________ Points | C | ________ _______ 2 | 0-3 | ________ _______ 1 | 4-10 | ________ _______ 0 |11+/c1a| ________ ________ (2) Problem 2a Correctness: 1 points _________________ Points | C | ________ _______ 1 | 0-2 | ________ _______ 0 |3+/c2a | ________ ________ (2) Problem 2b Correctness: 2 points _________________ Points | C | ________ _______ 2 | 0-2 | ________ _______ 1 | 3-6 | ________ _______ 0 | 7+/c3a/c3z | ________ ________ (3) Style worth 5 points ________ _____________ Points | S ________ _____________ 5 | 0-1 ________ _____________ 4 | 2-3 ________ _____________ 3 | 4-6 ________ _____________ 2 | 7-10 ________ _____________ 1 | 11-15 ________ _____________ 0 | 16+ ________ _____________