-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
26 lines (21 loc) · 712 Bytes
/
index.js
File metadata and controls
26 lines (21 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var rect = require('./rectangle');
function solveRect(l,b) {
console.log("Solving for rectangle with l = "
+ l + " and b = " + b);
rect(l,b, (err,rectangle) => {
if (err) {
console.log("ERROR: ", err.message);
}
else {
console.log("The area of the rectangle of dimensions l = "
+ l + " and b = " + b + " is " + rectangle.area());
console.log("The perimeter of the rectangle of dimensions l = "
+ l + " and b = " + b + " is " + rectangle.perimeter());
}
});
console.log("This statement after the call to rect()");
};
solveRect(2,4);
solveRect(3,5);
solveRect(0,5);
solveRect(-3,5);