Given a radius of the circle,
return the area and the circumference of the circle in 2 decimal places.
function CircleArea(r){
return Number((Math.PI*r*r).toFixed(2));
}
function CircleCir(r){
return Number((Math.PI*r*2).toFixed(2));
}
// TODO: Add your tests here
// Starting from Node 10.x, [Mocha](https://mochajs.org) is used instead of our custom test framework.
// [Codewars' assertion methods](https://github.com/Codewars/codewars.com/wiki/Codewars-JavaScript-Test-Framework)
// are still available for now.
//
// For new tests, using [Chai](https://chaijs.com/) is recommended.
// You can use it by requiring:
// const assert = require("chai").assert;
// If the failure output for deep equality is truncated, `chai.config.truncateThreshold` can be adjusted.
describe("Solution", function() {
it("should test for something", function() {
Test.assertEquals(CircleArea(0), 0);
Test.assertEquals(CircleArea(0.57), 1.02);
Test.assertEquals(CircleArea(1), 3.14);
Test.assertEquals(CircleCir(0), 0);
Test.assertEquals(CircleCir(0.16), 1.01);
Test.assertEquals(CircleCir(1), 6.28);
// assert.strictEqual(1 + 1, 2);
});
});