-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
96 lines (93 loc) · 3.13 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
var a = "shayan"
if (typeof a === "string") {
document.write("var a (" + a + ") is an string");
} else {
document.write("var a (" + a + ") is a number");
}
document.write("<hr />")
let num1 = parseInt(prompt("Enter the first integer:"));
let num2 = parseInt(prompt("Enter the second integer:"));
if (num1 > num2) {
document.write(num1 + " is larger than " + num2);
} else if (num2 > num1) {
document.write(num2 + " is larger than " + num1);
} else {
document.write("Both numbers are equal.");
}
document.write("<hr />")
let num = parseInt(prompt("Enter a number:"));
if (num > 0) {
document.write(num + " is positive.");
} else if (num < 0) {
document.write(num + " is negative.");
} else {
document.write("The number is zero.");
}
document.write("<hr />")
v = prompt("Enter a letter to check if it is vowel")
if (v == "a") {
document.write("This is a vowel a")
}
else if (v == "e") {
document.write("This is a Vowel e")
}
else if (v == "i") {
document.write("This is a Vowel i")
}
else if (v == "o") {
document.write("This is a Vowel o")
}
else if (v == "u") {
document.write("This is a Vowel u")
}
else {
document.write("this is a consonant " + v)
}
document.write("<hr />")
const correctPassword = prompt("Enter your password");
const userPassword = prompt("Enter your password to Confirm:");
if (!userPassword || !correctPassword) {
console.log("Please enter your password.");
} else if (userPassword === correctPassword) {
console.log("Correct! The password you entered matches the original password.");
} else {
console.log("Incorrect password.");
}
document.write("<hr />")
var greeting;
var hour =+ prompt("Enter Hour");
if (hour < 18) {
greeting = "Good day";
}
else {
greeting = "Good evening";
}
document.write(greeting);
document.write("<hr />")
var time =+ prompt("Enter Hour in 24 hour Format")
if (time >= 0000 && time <= 1200) {
document.write("Good Morning")
}
else if (time >= 1200 && time <= 1700) {
document.write("Good Afternoon")
}
else if (time >= 1700 && time <= 2100) {
document.write("Good Evening")
}
else if (time >= 2100 && time <= 2359) {
document.write("Good Night")
}
document.write("<hr />")
</script>
</body>
</html>