CMU Unit 2 Questions With Complete Solutions
Rules for function names - ️️Names must start with letters, but then can include letters or numbers. Can not use reserved words Can not have spaces Given the function shown, which would be a legal call for the code? def drawBigCircle(centerX, centerY, color): Circle(centerX, centerY, 200, 5, fill=color) - ️️drawBigCircle(200, 200, 'red') def drawPrettyStar(numberOfPoints, radius, color): Star(200, 200, radius, numberOfPoints, fill=color) What are the parameters of the function drawPrettyStar? - ️️numberofPoints, radius, color def drawShapes(centerX, centerY, radius, points, color): Star(centerX, centerY, radius, points, fill=color) Star(centerX, centerY, 40, 10, fill=color) drawShapes(300, 200, 'purple', 'blue') drawShapes(100, 200, 'red', 'black') How many shapes are drawn according to the code above? - ️️4
Written for
- Institution
- CMU
- Course
- CMU
Document information
- Uploaded on
- March 6, 2024
- Number of pages
- 2
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
Also available in package deal