Grading Guide for Assignment 4 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 # (i.e. 1,2,4...) cXa: doesn't compile, or throw exceptions, or no submitted file, or only submit class file... cXb: change the code we provided for Problem 1 (they only need to write functions "lhsrhs", "bisection" and "evalPileDepthEqn".) 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: // The increment = 0.01 in the solution. But the student can set their own 1. public static double lhsrhs() Test cases 1: c1c: [1, 1], LHSRHS: 3.421829999999973 EQN: 5.426759497715317E-4 c1d: [3, -1], LHSRHS: 3.4218299999999733 EQN: 5.426759497999534E-4 c1e: [3, 1], LHSRHS: 3.4218299999999933 EQN: 5.426759518747382E-4 // Note: The value of EQN just has to be close to zero, it doesn't have to be exactly what we have above. Test cases 2: c1f: [4, 1], No solution for LHSRHS . c1g: [1000, -1], No solution for LHSRHS . User input error handling: c1h: [-1, ...], wrong input, make the initial guess positive c1i: [4, 2], wrong input, make the direction be either 1 or -1 2. public static double bisection() Test cases 1: c1j: [1, 10], BISECTION: 3.421833038330078 EQN: 8.572817870748928E-4 c1k: [3, 30], BISECTION: 3.421823501586914 EQN: -1.3020234975380518E-4 c1l: [1, 1e70], BISECTION: 3.4218193302071196 EQN: -5.621250429066471E-4 If they wrote their own parsing function and cannot parse "1e70", try [1, 1000000] instead of [1, 1e70]. // Note: The value of EQN just has to be close to zero, it doesn't have to be exactly what we have above. Test cases 2: c1m: [4, 10], No solution for BISECTION. User input error handling: c1n: [-1, ...], wrong input, make it positive c1o: [4, 1], wrong input, make the second one larger than the first one ************************************************************************* Problem 2: style s2e: don't put everything into one big main() method; separate the functionality into different methods. test cases 1: interval=[0, 100]: (this testcase is divided into the following 3 codes...) c2c1: input 0, tell the user it is too low; c2c2: input 100, tell the user it is too high; c2c3: input 101, quit and return the answer; or input -1, quit and return the answer; c2d: interval=[2, 3]: try 2 and 3 ... either 2 or 3 is the answer, it also return how many guesses(1 or 2) it took the user to get the right answer. c2e: interval=[2, 3]: assume the answer = 3, guess 2 for three times, it should tell user "You were taking too long". test cases 2: c2f: interval=[4, 0], wrong input, make the second one larger than the first one user interface: c2g: it should ask for the lowest and highest value before each play. //it doesn't matter whether they ask for the lower bound first or the upper bound first. c2h: it should ask whether the user want to repeat the game or not after each play. c2i: program malfunction when user repeat the game (one possible reason is that they don't reset the variable count) ************************************************************************* Problem 1 worth 3 correctness points, Problem 2 worth 2 correctness points. Style worth 5 points. If they submit on time, give them 5 BONUS points. // If Problem 1 doesn't compile, they lose 3 correctness points. // If Problem 2 doesn't compile, they lose 2 correctness points. (1) Problem 1 Correctness: 3 points _________________ Points | C | ________ _______ 3 | 0-1 | ________ _______ 2 | 2-3 | ________ _______ 1 | 4-7 | ________ _______ 0 | 7+ | ________ ________ (2) Problem 2 Correctness: 2 points _________________ Points | C | ________ _______ 2 | 0-2 | ________ _______ 1 | 3-6 | ________ _______ 0 | 6+ | ________ ________ (3) Style worth 5 points ________ _____________ Points | S ________ _____________ 5 | 0-1 ________ _____________ 4 | 2 ________ _____________ 3 | 3-4 ________ _____________ 2 | 5 ________ _____________ 1 | 6 ________ _____________ 0 | 7+ ________ _____________ If they don't submit late (their submissions don't get pink), give them 5 BONUS points. ***********************************************************************