Created
August 7, 2020 19:31
-
-
Save Neptune998/4bd342591ea73500491944e6e4fefbef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main() { | |
// Write your code here. Read input using 'readLine()' and print output using 'console.log()'. | |
const PI = Math.PI; | |
var s = readLine(); | |
// Print the area of the circle: | |
console.log(PI*parseFloat(s)*parseFloat(s)); | |
// Print the perimeter of the circle: | |
console.log(2*PI*parseFloat(s)); | |
try { | |
// Attempt to redefine the value of constant variable PI | |
PI = 0; | |
// Attempt to print the value of PI | |
console.log(PI); | |
} catch(error) { | |
console.error("You correctly declared 'PI' as a constant."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment