วันพุธที่ 7 พฤศจิกายน พ.ศ. 2555

Hallo


Hollo

4.1 ให้นักเรียนเขียนโปรแกรมรับชื่อ นามสกุล เมื่อรับชื่อและนามสกุลแล้วให้แสดงกล่องตอบโต้ทักทายส่าสวัสดี ตามด้วยชื่อที่รับมา

<html>
<head>
<script language="javascript">//
<!--
var n;
var s;
n=prompt("Input Your Name");
s=prompt("Input Your S_Name");
alert("Hello"+n+s);

</script>
</head>
</html>

4.2 ให้นักเรียนเขียนโปรแกรมหาพื้นที่สี่เหลี่ยมผืนผ้า และแสดงผมการหาค่าทางกล่องตอบโต้


<html>
<head>
<script language="javascript">//
<!--
var w;
var h;
w=prompt("Please Fill in the width ");
h=prompt("Please Fill in the height");
alert("Area of a rectangle = "+w*h);

</script>
</head>
</html>

ไม่มีความคิดเห็น:

แสดงความคิดเห็น