Create an HTML document pythagoras.html which links an external stylesheet pytha
ID: 3550292 • Letter: C
Question
Create an HTML document pythagoras.html which links an external stylesheet pythagoras.css and an external JavaScript file pythagoras.js. The HTML file should contain no content between the tags.
In pythagoras.js, prompt the user for a number on page-load. This number should be between 10 and 300 (inclusive). If the user enters something invalid (not a number or out of range), prompt them again. Then, write the following table to the document using document.write:
<table>
<thead>
<tr>
<th>a</th>
<th>b</th>
<th>c</th>
</tr>
</thead>
<tr>
<td>
Explanation / Answer
Hi dude :) Done everyting .. single part remains ... Till then check this :
<!DOCTYPE html>
<html>
<head>
<script>
var n=0;
function myFunction()
{
N=prompt("enter value of N");
if( N <=200 && N >=1 )
{
calc();
}
else
{
n=0;
myFunction();
}
}
function calc()
{
var count1=0;
var count2=0;
for (var i = 1; i < N; i++)
{
for (var j = 1; j < N; j++)
{
for (var k = 1; k < N; k++)
{
if(((i*i)+(j*j))===(k*k))
{
if((i+j)===7 && count1===0)
{
count1=count1+1;
continue;
}
else if((i+j)===14 && count2===0)
{
count2=count2+1;
continue;
}
else
{
document.write("["+i+","+j+","+k+"]"+ "<br>");
}
}
}
}
}
}
</script>
</head>
<body>
</body>
</html>
Regards
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.