← Back to Functions
Question 332
Rectangle Perimeter Function
Rectangle Perimeter Function
Complete perimeter(width: int, height: int) -> int so it returns the distance around the rectangle, twice the sum of the width and the height. The driver reads two whole numbers and prints what the function returns; leave it alone. Input: two lines, the width then the height, no prompts. Output: the perimeter on one line.
Expected Output:
14= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
Functions
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.