function calculateArea (r) {
var area ;
if (r <= 0) {
return 0;
} else {
area = Math.PI * r * r ;
return area ;
}
}
var radius = 5.2 ;
var theArea = calculateArea (radius) ;
console.log("The area is: " + theArea ) ;
console.log("The area is: " + calculateArea (5.2) ) ;
console.log("The area is: " + (function (r) {
return (r <= 0) ? 0 : Math.PI * r * r ;
})(5.2));