CMU 15-112 Summer 2020: Fundamentals of Programming and Computer Science
Collab 2 (Due Tue 19-May, at 11:59pm)
- This assignment is COLLABORATIVE. This means you may work with your week's collaboration group within the course collaboration boundaries. See the syllabus for details.
- To start:
- Create a folder named 'collab2'
- Download collab2.py and cs112_m20_day2_linter.py to that folder
- Edit collab2.py using VSCode
- When you are ready, submit collab2.py to Autolab. For this hw, you may submit up to 20 times (which is way more than you should require), but only your last submission counts.
- Do not use string indexing, lists, or recursion in this assignment.
- Do not hardcode the test cases in your solutions.
- carrylessAdd [35pts]
First, read the first page (page 44) from here about Carryless Arithmetic. Fun! Then, write the function carrylessAdd(x, y) that takes two non-negative integers x and y and returns their carryless sum. Here are a couple examples:carrylessAdd(785, 376) returns 51 carrylessAdd(865, 23) returns 888
Make sure you handle the case where the numbers are different lengths!