Քննություն

<!DOCTYPE html>
<html>
    <head>
       <title>Գլխավոր</title>
       <meta charset=”utf-8″>
    <link rel=”stylesheet” href=”css/style.css”>
    </head>
    <body>
        <div class =”main1″>
        <script>
        var numberArray=[34.82, 12.90, 17.01, 78.51];
        function kloracum(testArray, roundMethod){
            if (roundMethod==”round”) {
                for(var i=0; i<testArray.length; i++){
                    testArray[i]=Math.round(testArray[i]);
                }
                document.write(testArray+”<br>”);
            }
            else if(roundMethod==”ceil”){
                for (var i = 0; i < testArray.length; i++) {
                    testArray[i]=Math.ceil(testArray[i]);
                }
                document.write(testArray+”<br>”);
            }
            else if(roundMethod==”floor”){
                for(var i=0; i<testArray.length; i++){
                    testArray[i]=Math.floor(testArray[i]);
                }
                document.write(testArray+”<br>”);
            }
            else{
                document.write(“Մուտքագրված է սխալ մեթոդ։ <br>”);
            }
        }
        var method1=prompt(“Մուտքագրեք կլորացման մեթոդը։”);
        kloracum(numberArray, method1);
             </script>
        </div>
        </body>
        </html>

Leave a Reply

Your email address will not be published. Required fields are marked *