Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                
<html>
        <head> 
        <meta charset="utf-8"><meta http-equiv="Content-Type">
        <title> Výpočet povrchu kužele</title>
    </head>
<body>
    
    
 <h1>Výpočet Povrchu Kužele</h1>
<p id="va3"></p>
<p id="w"></p>
<p id="w_zv"></p>
<p id="S1"></p>
<p id="SPL"></p>
<p id="SP"></p>
<p id="S"></p>

<footer> 
    <p class ="created-by"> © 2017 Lukáš Hanák (Brother of Hanny), all rights reserved  </p> 
</footer>

</body>

              
            
!

CSS

              
                    
    .va3  {
         padding-bottom: 25px;
    }
    
    .w {
         padding-bottom: 25px;
    }
    
    .S1{
          padding-bottom: 25px;
    }
    
    .SPL{
          padding-bottom: 25px;
    }
    
    .SP{
          padding-bottom: 25px;
    }
    
    .S {
         padding-bottom: 25px;
    }
 
    
 h1 {   
  font-size: 95px;
  text-align: center;
  color: green;
}

p {
  text-align: center;
  padding-left: 0px;
  padding-top: 0px; 
  font-size: 40px;
}

.created-by {
    padding-top: 100px;
    text-align: center;
    font-size: 30px;
    color: greenyellow;
}

              
            
!

JS

              
                
 var a = prompt ("Kolik je délka na stranu a?");
 var v = prompt ("Jaká je délka výšky v?");
 var h = prompt ("Jaká je délka boční strany h?");
 var pocetStran = prompt ("Kolik má podstava počet stran?");
 
var a = Number(a); 
var v = Number(v);
var h = Number(h);
var pocetStran = Number(pocetStran);


function ziskat_w () { 
    if ( v === 0 )  {
h_na_druhou = h * h;
polovina_a = a / 2;
prototype_w = h_na_druhou - (polovina_a * polovina_a);
w= Math.sqrt (prototype_w);
return "Stěnová výška w = " + w.toFixed(2);
    }
    
  else if ( h === 0) {
v_na_druhou = v * v;
polovina_a = a / 2;
prototype_w = v_na_druhou + (polovina_a * polovina_a);
w= Math.sqrt (prototype_w);
return "Stěnová výška  w = " + w.toFixed(2);
  }

  else {
      return "Stěnová výška w je neznáma";
  }
}


function ziskat_va3 () { 
  a_na_druhou = a * a;
  polovina_a = a / 2;
  prototype_va3 = a_na_druhou - (polovina_a * polovina_a);
  va3 = Math.sqrt(prototype_va3);
  return "Výška na stranu a va = " + va3.toFixed(2);
}


function ziskat_S1 () {
    polovina_a = a / 2;
    S1 = polovina_a * w;
    return "Obsah jednoho trojuhelniku S1 = " + S1.toFixed(2); 
}


function ziskat_SPL () {
  SPL = pocetStran * S1;
  return "Obsah jednoho pláště SPL = " + SPL.toFixed(2);
}

function ziskat_SP () {
    if (pocetStran ===  3) {
        SP = a * va3 / 2;
        return "Obsah podstavy SP = " + SP.toFixed(2);
    }
    else if (pocetStran === 4) {
         SP = a * a;
          return "Obsah podstavy SP = " + SP.toFixed(2);
    }
     else  {
   
          SP = a * a;  // THAT'S WRONG, IT HAVE TO BE REPAIRED TO a * b later 
          return "Obsah podstavy SP = " + SP.toFixed(2);
    }
}

function ziskat_S () {
    prototype_S = SPL + SP;
    S = prototype_S;
   return "Obsah kužele S = " + S.toFixed(2);
}

document.getElementById("va3").innerHTML = ziskat_va3(a);
document.getElementById("w").innerHTML = ziskat_w(a,h);
document.getElementById("S1").innerHTML = ziskat_S1 (a,w);
document.getElementById("SPL").innerHTML = ziskat_SPL ();
document.getElementById("SP").innerHTML = ziskat_SP ();
document.getElementById("S").innerHTML = ziskat_S ();
              
            
!
999px

Console