Codingbat Python Questions and Answers Section 2 This document is prepared and can be used only for educational purposes. All questions are taken from http:/ /codingbat.com which contains great questions about Python and Java. Please go to original website and solve questions there. Codingbat also...
pythonquestionsanswersstrreturnsection CodingbatPythonQuestionsandAnswersSection1Thisdocumentispreparedandcanbeusedonlyforeducationalpurposes.Allquestionsaretakenfromhttp://codingbatwhichcontainsgreatquestionsaboutPythonandJava.Pleasegotooriginalwebsiteandsolvequestionsthere.Codingbatalsopresentsareporttoolwhicheducatorscansee...
Java Pythontlsmith2@wsfcs.k12.nc.us > gradeTests prev | next | chance The "key" array is an array containing the correct answers to an exam, like {"a", "a", "b", "b"}. the "answers" array contains a student's answers, with "?" representing a question left blank. The two ...
1 2 3 4 5 public int countX(String str) { if (str.length() == 0) return 0; if (str.charAt(0) == 'x') return 1 + countX(str.substring(1)); return countX(str.substring(1)); } For further help with Coding Bat (Java), please check out my books. I am also available fo...
1 2 3 4 5 6 7 public int scoreUp(String[] key, String[] answers) { int sum = 0; for (int i = 0; i < answers.length; i++) if (answers[i] == key[i]) sum += 4; else if (!answers[i].equals("?")) sum -= 1; return sum; } ...
/codingbat.com which contains great questions about Python and Java. Please go to original website and solve questions there. Codingbat also presents a report tool which educators can see students’ results.The answers are done by me in my spare times, Codingbat says all answers are true. I ...
comparing my answers of the Codingbat problems to yours and I have learnt quite a bit form your examples. However, here I have to agree with Frank. You solution on “has12” is flawed. To quote: “if there is A 1 in the array with a 2 somewhere later” specifies a single possible ...