CJCoding With Joseph
15free / daySign inCreate account

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
Topics:
Functions
📥 Auto-Input:
3\n4\n
This input is automatically fed to your program's stdin
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.