Answer to Question #269922 in HTML/JavaScript Web Application for prime

Question #269922

I want pass all test cases

Sample Input 1

7

Sample Output 1

153.86
43.96

Sample Input 2

25

Sample Output 2

1962.5
157

"use strict";

process.stdin.resume();

process.stdin.setEncoding("utf-8");

let inputString = "";

let currentLine = 0;

process.stdin.on("data", (inputStdin) => {

 inputString += inputStdin;

});

process.stdin.on("end", (_) => {

 inputString = inputString.trim().split("\n").map((str) => str.trim());

 main();

});

function readLine() {

 return inputString[currentLine++];

}

/* Please do not modify anything above this line */

function Circle(radius) { 

 /* Write your code here */

}

/* Please do not modify anything below this line */

function main() {

 const radius = JSON.parse(readLine());

 const circle1 = new Circle(radius);

 console.log(circle1.getArea());

 console.log(circle1.getCircumference());

}



1
Expert's answer
2021-11-24T00:43:26-0500
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");
let inputString = "";
let currentLine = 0;
process.stdin.on("data", (inputStdin) => {
    inputString += inputStdin;
});
process.stdin.on("end", (_) => {
    inputString = inputString.trim().split("\n").map((str) => str.trim());
    main();
});


function readLine() {


    return inputString[currentLine++];


}


/* Please do not modify anything above this line */


function Circle(radius) {


    return Math.PI * radius * radius;


}


/* Please do not modify anything below this line */


function main() {


    const radius = JSON.parse(readLine());


    const circle1 = new Circle(radius);


    console.log(circle1.getArea());


    console.log(circle1.getCircumference());


}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS