You are on page 1of 3

PETER ABIRA

DICT17S/28626

IBP

1. <!DOCTYPE html>

<html lang="en">

<head>

<title>Js </title>

</head>

<body>

<script>

let y = 1

while(x <= 10){

document.write(y)

y++;

</script>

</body>

</html>

2.<!DOCTYPE html>

<html lang="en">

<head>

<title>Document</title>

</head>
<body>

<button onclick="findArea()" >Rectange Number</button>

<script>

function findArea(){

let height = prompt("Enter height")

let width = prompt("Enter width")

area = (height * width)

document.write('The area of the rectangle is ',area)

</script>

</body>

</html>

3. DOCTYPE html>

<html>

<head>
<title>Document</title>

</head>

<body>

<button onclick="round()" >Round Number</button>

<script>

function round() {

user = prompt("Key in a number")

number = Math.round(user)

document.write('The rouned number to the nearest integer is ',number)

</script>

</body>

</html>

You might also like