Image Mapping
India State
<!DOCTYPE html>
<html>
<head>
<title>India Map Image Map</title>
</head>
<body>
<h2>India Map – Click on a State</h2>
<img src="india_map.jpg" usemap="#india" alt="India Map" width="500">
<map name="india">
<!-- Maharashtra -->
<area shape="rect" coords="120,260,200,330"
href="maharashtra.html"
alt="Maharashtra">
<!-- Gujarat -->
<area shape="rect" coords="60,220,120,300"
href="gujarat.html"
alt="Gujarat">
<!-- Karnataka -->
<area shape="rect" coords="130,320,200,380"
href="karnataka.html"
alt="Karnataka">
</map>
</body>
</html>
This program accepts roll number, student name and marks of three subjects using an HTML form.
PHP is used to calculate total marks, percentage and remark based on given conditions.
If the student gets less than 50 marks in subjects, ATKT or FAIL is declared and total/percentage is not calculated.
<!DOCTYPE html>
<html>
<head>
<title>Student Result</title>
</head>
<body>
<h2>Student Result Form</h2>
<form method="post">
Roll No: <input type="text" name="roll"><br><br>
Name: <input type="text" name="name"><br><br>
Subject 1 Marks: <input type="number" name="m1"><br><br>
Subject 2 Marks: <input type="number" name="m2"><br><br>
Subject 3 Marks: <input type="number" name="m3"><br><br>
<input type="submit" name="submit" value="Calculate Result">
</form>
<?php
if (isset($_POST['submit'])) {
$roll = $_POST['roll'];
$name = $_POST['name'];
$m1 = $_POST['m1'];
$m2 = $_POST['m2'];
$m3 = $_POST['m3'];
$failCount = 0;
if ($m1 < 50) $failCount++;
if ($m2 < 50) $failCount++;
if ($m3 < 50) $failCount++;
echo "<h3>Result</h3>";
echo "Roll No: $roll <br>";
echo "Name: $name <br>";
if ($failCount > 1) {
echo "Remark: FAIL";
}
else if ($failCount == 1) {
echo "Remark: ATKT";
}
else {
$total = $m1 + $m2 + $m3;
$percentage = ($total / 300) * 100;
echo "Total Marks: $total <br>";
echo "Percentage: $percentage % <br>";
if ($percentage >= 70) {
echo "Remark: Distinction";
}
else if ($percentage >= 60) {
echo "Remark: First Class";
}
else if ($percentage >= 50) {
echo "Remark: Second Class";
}
}
}
?>
</body>
</html>
Write a JavaScript code to accept any four-digit number from user and
display sum of digits and also display accepted digits in reverse order.
<!DOCTYPE html>
<html>
<head>
<title>Sum and Reverse of Digits</title>
</head>
<body>
<script>
let num = parseInt(prompt("Enter any four digit number:"));
let temp = num;
let sum = 0;
let reverse = 0;
while (temp > 0) {
let digit = temp % 10;
sum = sum + digit;
reverse = reverse * 10 + digit;
temp = Math.floor(temp / 10);
}
document.write("Entered Number: " + num + "<br>");
document.write("Sum of Digits: " + sum + "<br>");
document.write("Reverse Number: " + reverse);
</script>
</body>
</html>
Write a JavaScript code to display odd as well as even numbers from
accepted start number to accepted limit value and also display odd
number series summation and even number series summation.
<!DOCTYPE html>
<html>
<head>
<title>Odd and Even Numbers</title>
</head>
<body>
<script>
let start = parseInt(prompt("Enter starting number:"));
let limit = parseInt(prompt("Enter limit number:"));
let oddSum = 0;
let evenSum = 0;
document.write("Even Numbers: <br>");
for (let i = start; i <= limit; i++) {
if (i % 2 == 0) {
document.write(i + " ");
evenSum += i;
}
}
document.write("<br><br>Odd Numbers: <br>");
for (let i = start; i <= limit; i++) {
if (i % 2 != 0) {
document.write(i + " ");
oddSum += i;
}
}
document.write("<br><br>Sum of Even Numbers: " + evenSum);
document.write("<br>Sum of Odd Numbers: " + oddSum);
</script>
</body>
</html>