python

lamlam
feedback.txt

Hi, this is Ellie Cheong, looking at your Assignment A1. Please revise your A1 solution as we suggest below. Look at each point and revise according to it before going on to the next. When done, resubmit. THEN SUBMIT A REQUEST FOR A REGRADE, SAYING SIMPLY THAT YOU RESUBMITTED. This is how we will know to regrade it. If we don’t get this regrade request, there will be no easy way for us to know that you resubmitted. Be sure you have set your notifications on the CMS so that you receive an email when a grade has been changed. =========== Start grading of hr349/a1.py Max points for A1 Functions: 45 Max points for Part A (Space breaking functions): 13 Finished Part A (Space breaking functions) Max points for Part B (JSON extraction utilities): 14 Finished Part B (JSON extraction utilities) Max points for Part C (Currency query connection): 6 Finished Part C (Currency query connection) Max points for Part D (Currency functions): 12 Finished Part D (Currency functions) Finished A1 Functions Max points for A1 Test Cases: 29 Max points for Tests for Part A: 9 The following test cases have the wrong outputs: 1 point deducted. assert_equals (line 31): expected ' CubanPeso' but instead got 'CAD' You are missing 2 tests for before_space. 2 points deducted. You are missing 2 tests for after_space. 2 points deducted. The test on line 22 does not have an explanatory comment: 1 point deducted. introcs.assert_equals('5', a1.before_space('5 USD')) The test on line 23 does not have an explanatory comment: 1 point deducted. introcs.assert_equals('', a1.before_space(' ')) The test on line 24 does not have an explanatory comment: 1 point deducted. introcs.assert_equals('10', a1.before_space('10 AED')) The test on line 25 does not have an explanatory comment: 1 point deducted. introcs.assert_equals('2', a1.before_space('2 CAD')) The test on line 28 does not have an explanatory comment: Maximum deduction reached. introcs.assert_equals('USD', a1.after_space('5 USD')) The test on line 29 does not have an explanatory comment: Maximum deduction reached. introcs.assert_equals('', a1.after_space(' ')) The test on line 30 does not have an explanatory comment: Maximum deduction reached. introcs.assert_equals('AED', a1.after_space('10 AED')) The test on line 31 does not have an explanatory comment: Maximum deduction reached. introcs.assert_equals(' CubanPeso', a1.after_space('2 CAD')) Finished Tests for Part A Max points for Tests for Part B: 11 You are missing one last test for get_lhs. 1 point deducted. The test on line 42 does not have an explanatory comment: 1 point deducted. introcs.assert_equals('Y', a1.first_inside_quotes('X "Y"Z')) The test on line 43 does not have an explanatory comment: 1 point deducted. introcs.assert_equals('', a1.first_inside_quotes('""')) The test on line 44 does not have an explanatory comment: 1 point deducted. introcs.assert_equals('XYZ', a1.first_inside_quotes('"XYZ"')) The test on line 45 does not have an explanatory comment: 1 point deducted. introcs.assert_equals('Y', a1.first_inside_quotes('X "Y" "Z"')) The test on line 49 does not have an explanatory comment: 1 point deducted. introcs.assert_equals('5 USD', result) The test on line 51 does not have an explanatory comment: 1 point deducted. introcs.assert_equals('', result) The test on line 56 does not have an explanatory comment: 1 point deducted. introcs.assert_equals('4.61 Euros', result) The test on line 58 does not have an explanatory comment: 1 point deducted. introcs.assert_equals('18.37 AED', result) The test on line 60 does not have an explanatory comment: 1 point deducted. introcs.assert_equals('', result) The test on line 64 does not have an explanatory comment: 1 point deducted. introcs.assert_equals(False, result) The test on line 66 does not have an explanatory comment: Maximum deduction reached. introcs.assert_equals(False, result) The test on line 68 does not have an explanatory comment: Maximum deduction reached. introcs.assert_equals(True, result) Finished Tests for Part B Max points for Tests for Part C: 4 The following test cases have the wrong outputs: 1 point deducted. assert_equals (line 84): expected '{ "ok":true, "lhs":"5 United States Dollar", "rhs":"18.37 United Arab Emirates Dirham", "err":"" }' but instead got '{ "ok":true, "lhs":"5 Australian Dollars", "rhs":"3.5103337204061 United States Dollars", "err":"" }' The test on line 80 does not have an explanatory comment: 1 point deducted. introcs.assert_equals('{ "ok":true, "lhs":"1 United States ' + 'Dollar", "rhs":"1 United States Dollar", "err":"" }' The test on line 83 does not have an explanatory comment: 1 point deducted. introcs.assert_equals('{ "ok":true, "lhs":"5 United States Dollar", ' + '"rhs":"18.37 United Arab Emirates Dirham"' The test on line 86 does not have an explanatory comment: 1 point deducted. introcs.assert_equals('{ "ok":false, "lhs":"", "rhs":""' + ', "err":"Exchange currency code is invalid." }', result) The test on line 88 does not have an explanatory comment: Maximum deduction reached. introcs.assert_equals('{ "ok":false, "lhs":"", "rhs":"", ' + '"err":"Source currency code is invalid." }', result) Finished Tests for Part C Max points for Tests for Part D: 5 The procedure 'testD' crashed when called. 4 points deducted. Traceback (most recent call last): File "a1grade/rubrik.py", line 890, in grade_test_D a1test.testD() File "a1test.py", line 106, in testD result = a1.get_rhs(bads) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/introcs/testcase.py", line 443, in assert_floats_equal quit_with_error(message) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/introcs/testcase.py", line 304, in quit_with_error quit() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/_sitebuiltins.py", line 26, in __call__ raise SystemExit(code) SystemExit: None The test on line 98 does not have an explanatory comment: 1 point deducted. introcs.assert_equals(True, a1.is_currency('USD')) The test on line 99 does not have an explanatory comment: Maximum deduction reached. introcs.assert_equals(True, a1.is_currency('AED')) The test on line 100 does not have an explanatory comment: Maximum deduction reached. introcs.assert_equals(False,a1.is_currency('XYZ')) The test on line 104 does not have an explanatory comment: Maximum deduction reached. introcs.assert_floats_equal(5, result) The test on line 106 does not have an explanatory comment: Maximum deduction reached. introcs.assert_floats_equal(183.66, result) Finished Tests for Part D Finished A1 Test Cases Max points for A1 Application: 11 Max points for User Input: 5 Finished User Input Max points for Output Formats: 6 Finished Output Formats Finished A1 Application Max points for Coding Style: 15 Max points for File a1.py: 5 The docstring for 'a1.py' does not include a valid date after Date: 0.5 points deducted. Line 149 of 'a1.py' is too long (113 characters) and must be broken up: 1 point deducted. url = 'http://cs1110.cs.cornell.edu/2019fa/a1?' + 'src=' + src + '&' + 'dst=' + dst + '&' + 'amt=' + str(amt) Finished File a1.py Max points for File a1test.py: 5 The docstring for 'a1test.py' does not include a valid date after Date: 0.5 points deducted. The specification for function 'testA' is not correct on the first line. 1 point deducted. Given: Test Procedure for Part A Testing before_space and after_space functions Want: Test procedure for Part A The specification for function 'testD' is not correct on the first line. 1 point deducted. Given: Test Procedure for Part D Testing is_currency and exchange function Want: Test procedure for Part D Line 59 of 'a1test.py' is too long (108 characters) and must be broken up: 1 point deducted. result = a1.get_rhs('{ "ok":false, "lhs":"", "rhs":"",' + ' "err":"Source currency code is invalid." }') Line 67 of 'a1test.py' is too long (110 characters) and must be broken up: 1 point deducted. result = a1.has_error('{ "ok":false, "lhs":"", "rhs":"",' + ' "err":"Source currency code is invalid." }') Line 80 of 'a1test.py' is too long (120 characters) and must be broken up: 0.5 points deducted. introcs.assert_equals('{ "ok":true, "lhs":"1 United States ' + 'Dollar", "rhs":"1 United States Dollar", "err":"" }' Line 83 of 'a1test.py' is too long (119 characters) and must be broken up: Maximum deduction reached. introcs.assert_equals('{ "ok":true, "lhs":"5 United States Dollar", ' + '"rhs":"18.37 United Arab Emirates Dirham"' Line 84 of 'a1test.py' is too long (99 characters) and must be broken up: Maximum deduction reached. ', "err":"" }', result) Line 86 of 'a1test.py' is too long (120 characters) and must be broken up: Maximum deduction reached. introcs.assert_equals('{ "ok":false, "lhs":"", "rhs":""' + ', "err":"Exchange currency code is invalid." }', result) Line 88 of 'a1test.py' is too long (118 characters) and must be broken up: Maximum deduction reached. introcs.assert_equals('{ "ok":false, "lhs":"", "rhs":"", ' + '"err":"Source currency code is invalid." }', result) Finished File a1test.py Max points for File a1app.py: 5 The docstring for 'a1app.py' does not include a valid date after Date: 0.5 points deducted. Line 16 of 'a1app.py' is too long (118 characters) and must be broken up: 1 point deducted. print('You can exchange ' + str(amount) + ' ' + source_currency + ' for ' + str(result) + ' ' + target_currency + ".") Finished File a1app.py Finished Coding Style 1. A1 Functions 45 out of 45 A. Part A (Space breaking functions) (13 ) B. Part B (JSON extraction utilities) (14 ) C. Part C (Currency query connection) ( 6 ) D. Part D (Currency functions) (12 ) 2. A1 Test Cases 0 out of 29 A. Tests for Part A ( 0 ) B. Tests for Part B ( 0 ) C. Tests for Part C ( 0 ) D. Tests for Part D ( 0 ) 3. A1 Application 11 out of 11 A. User Input ( 5 ) B. Output Formats ( 6 ) 4. Coding Style 7.0 out of 15 A. File a1.py ( 3.5) B. File a1test.py ( 0.0) C. File a1app.py ( 3.5) ------------------------------------------------------- Total 63.0 out of 100 Deductions: Total out of 100