Skip to content

Commit 3a427d2

Browse files
authored
Created arithmeticOperators.js
1 parent 92aa3e0 commit 3a427d2

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* Calculate the area of a rectangle.
3+
*
4+
* length: The length of the rectangle.
5+
* width: The width of the rectangle.
6+
*
7+
* Return a number denoting the rectangle's area.
8+
**/
9+
function getArea(length, width) {
10+
let area;
11+
// Write your code here
12+
area= length * width;
13+
14+
return area;
15+
}
16+
17+
/**
18+
* Calculate the perimeter of a rectangle.
19+
*
20+
* length: The length of the rectangle.
21+
* width: The width of the rectangle.
22+
*
23+
* Return a number denoting the perimeter of a rectangle.
24+
**/
25+
function getPerimeter(length, width) {
26+
let perimeter;
27+
// Write your code here
28+
perimeter= 2 * (length+width);
29+
30+
return perimeter;
31+
}

0 commit comments

Comments
 (0)