Skip to content

Commit adcbb7b

Browse files
authored
Add files via upload
1 parent 703fb55 commit adcbb7b

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
'use strict';
2+
3+
process.stdin.resume();
4+
process.stdin.setEncoding('utf-8');
5+
6+
let inputString = '';
7+
let currentLine = 0;
8+
9+
process.stdin.on('data', inputStdin => {
10+
inputString += inputStdin;
11+
});
12+
13+
process.stdin.on('end', _ => {
14+
inputString = inputString.trim().split('\n').map(string => {
15+
return string.trim();
16+
});
17+
18+
main();
19+
});
20+
21+
function readLine() {
22+
return inputString[currentLine++];
23+
}
24+
25+
/**
26+
* Calculate the area of a rectangle.
27+
*
28+
* length: The length of the rectangle.
29+
* width: The width of the rectangle.
30+
*
31+
* Return a number denoting the rectangle's area.
32+
**/
33+
function getArea(length, width) {
34+
let area;
35+
// Write your code here
36+
area = length * width;
37+
return area;
38+
}
39+
40+
/**
41+
* Calculate the perimeter of a rectangle.
42+
*
43+
* length: The length of the rectangle.
44+
* width: The width of the rectangle.
45+
*
46+
* Return a number denoting the perimeter of a rectangle.
47+
**/
48+
function getPerimeter(length, width) {
49+
let perimeter;
50+
// Write your code here
51+
perimeter = 2* (length + width);
52+
return perimeter;
53+
}
54+

0 commit comments

Comments
 (0)