Advertisement
Guest User

Untitled

a guest
Jun 25th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=utf-8">
  5. <meta name="generator" content="PSPad editor, www.pspad.com">
  6. <title></title>
  7. </head>
  8.  
  9. <body>
  10. <img src="koule.jpg">
  11. <script>
  12. var polomer = prompt("Zadej Poloměr: [mm]");
  13. var input = prompt("Zadej co chceš spočítat: (P = Povrch, O = Objem)");
  14.  
  15. input = input.toLowerCase();
  16.  
  17. if(input != null && input == "p"){
  18. var result = 4 * Math.PI * Math.pow(polomer, 2);
  19. document.write("Povrch: " + result +" mm2");
  20. }
  21. if(input != null && input == "o"){
  22. var result = (4/3) * Math.PI * Math.pow(polomer, 3);
  23. document.write("Objem: " + result +" mm3");
  24. }
  25. </script>
  26. </body>
  27. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement