-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
121 lines (121 loc) · 3.97 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!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 city = prompt("Enter City").toLowerCase();
if (city == "karachi") {
document.write("Welcome to city of Lights")
}
else if (city == "islamabad") {
document.write("Welcome to Captail City of Pakistan")
}
else {
document.write("Welcome to city of " + city)
}
document.write("<hr>")
var gender = prompt("Enter your Gender").toLowerCase();
if (gender == "male") {
document.write("Good Morning Sir")
}
else if (gender == "female") {
document.write("Good Morning Ma'am")
}
else {
document.write("Cannot Recongnize the gender")
}
document.write("<hr>")
var color = prompt("Enter Traffic Color").toLowerCase();
if (color == "red") {
document.write("You must stop")
}
else if (color == "yellow") {
document.write("Ready to go")
}
else if (color == "green") {
document.write("Move Now")
}
else {
document.write("You can only input 'red', 'yellow' & 'green'")
}
document.write("<hr>")
var feul = prompt("Enter feul in your car")
if (feul <= 2.5) {
document.write("Please refeul your car")
}
else {
document.write("You can move")
}
document.write("<hr>")
var std_name = prompt("Enter Your Name");
var roll = prompt("Enter Your Roll Number");
var maths = + prompt("Enter Your Maths marks out of 100");
var sst = + prompt("Enter Your Social Studies Marks out of 100");
var sci = + prompt("Enter Your Science Marks out of 100");
var eng = + prompt("Enter Your English Marks out of 100");
var t_m = maths + sst + sci + eng;
document.write("<h1>" + "Student Name = " + std_name + "</h1>" + "<br>" + "Total Marks of " + std_name + " = " + t_m + "<br>" + "Percentage of " + std_name + " = " + t_m / 400 * 100 + "%");
var percentage = + t_m / 400 * 100;
if (percentage >= 100) {
document.write("<br>" + "Grade of " + std_name + " =" + "A")
document.write("<br>" + "Remarks = " + "Excellent")
}
else if (percentage >= 90) {
document.write("<br>" + "Grade of " + std_name + " =" + "B")
document.write("<br>" + "Remarks = " + "Good")
}
else if (percentage >= 80) {
document.write("<br>" + "Grade of " + std_name + " =" + "C")
document.write("<br>" + "Remarks = " + "You need to Improve")
}
else if (percentage >= 70) {
document.write("<br>" + "Grade of " + std_name + " =" + "D")
document.write("<br>" + "Remarks = " + "Sorry")
}
else {
document.write("<br>" + "Grade of " + std_name + " =" + "Fail")
document.write("<br>" + "Remarks = " + "Get out of the house")
}
document.write("<hr>")
var secNum = 10
var guess =+ prompt("Enter guessed Number")
if(guess == secNum){
document.write("Bingo! Correct answer")
}
else if(secNum+1 == guess){
document.write("Close enough to right answer")
}
else{
document.write("Wrong Answer")
}
document.write("<hr>")
var user = prompt("Enter number to check divisibility by 3")
if(user%3 == 0){
document.write(user + " is divisible by 3")
}
else{
document.write(user + " is not divisible by 3")
}
document.write("<hr>")
var t = prompt ("Enter Today temperature")
if (t>"40"){
document.write("It is too hot outside")
}
else if (t>"30"){
document.write("The Weather today is Normal.")
}
else if (t>"20"){
document.write("Today’s Weather is cool.")
}
else if (t>"10"){
document.write("OMG! Today’s weather is so Cool.")
}
document.write("<hr>")
</script>
</body>
</html>