We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c1a47a commit b0b3005Copy full SHA for b0b3005
Hackerrank solutions/10 days of js/Create_Rectangle_Object.js
@@ -0,0 +1,33 @@
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
+ * Complete the Rectangle function
27
+ */
28
+function Rectangle(a,b) {
29
+ this.length = a;
30
+ this.width = b;
31
+ this.perimeter = 2 * (a + b);
32
+ this.area = (a * b);
33
+ }
0 commit comments