CMU 15-112 Summer 2020: Fundamentals of Programming and Computer Science
Collab 1 (Due Mon 18-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 'collab1'
- Download
collab1.py and cs112_m20_week1_linter.py
to that folder
- Edit collab1.py using VSCode
- When you are ready, submit collab1.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, loops, lists, or recursion in this assignment.
- Do not hardcode the test cases in your solutions.
- isEquilateralTriangle(side1,side2,side3) [25pts]
Write the function isEquilateralTriangle(side1,side2,side3) that takes three sides to a triangle. The sides will be positive floats/ints. Return True if the 3 sides make up an equilateral triangle. Returns False otherwise. Hint: almostEquals might be helpful here.
- isPerfectSquare(n) [25pts]
Write the function isPerfectSquare(n) that takes a possibly-non-int value, and returns True if it is an int that is a perfect square (that is, if there exists an integer m such that m**2 == n), and False otherwise. Do not crash on non-ints nor on negative ints.