-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
23 lines (20 loc) · 702 Bytes
/
index.js
File metadata and controls
23 lines (20 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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);