374,066 views
23 votes
23 votes
Make variables to represent the length and width of a rectangle, called length and width, respectively. You should set length to 10 and width to 5. Then, write some mathematical expressions to compute the area and perimeter of the rectangle and save these values inside variables named area and perimeter. Use print statements to display the area and perimeter of the rectangle. Your output should print the area on the first line and the perimeter on the second, like this: 50 30

User ErickXavier
by
2.9k points

2 Answers

20 votes
20 votes

Final answer:

To find the area and perimeter of a rectangle with length 10 and width 5, we can use the formulas Area = length * width and Perimeter = 2 * (length + width). Substituting the given values, we find that the area is 50 and the perimeter is 30.

Step-by-step explanation:

To find the area and perimeter of a rectangle with length 10 and width 5, we can use the following formulas:

Area = length * width

Perimeter = 2 * (length + width)

Substituting the given values, we get:

Area = 10 * 5 = 50

Perimeter = 2 * (10 + 5) = 30

Therefore, the area of the rectangle is 50 and the perimeter is 30.

User Bitta
by
3.0k points
25 votes
25 votes
Hope this helps. Please rate it if it does. Thanks will appreciate it.
Make variables to represent the length and width of a rectangle, called length and-example-1
User Knio
by
3.1k points