Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="generator" content="PSPad editor, www.pspad.com">
- <title></title>
- </head>
- <body>
- <img src="koule.jpg">
- <script>
- var polomer = prompt("Zadej Poloměr: [mm]");
- var input = prompt("Zadej co chceš spočítat: (P = Povrch, O = Objem)");
- input = input.toLowerCase();
- if(input != null && input == "p"){
- var result = 4 * Math.PI * Math.pow(polomer, 2);
- document.write("Povrch: " + result +" mm2");
- }
- if(input != null && input == "o"){
- var result = (4/3) * Math.PI * Math.pow(polomer, 3);
- document.write("Objem: " + result +" mm3");
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement