-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathques edit.html
More file actions
96 lines (71 loc) · 3.61 KB
/
ques edit.html
File metadata and controls
96 lines (71 loc) · 3.61 KB
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>
<!DOCTYPE html>
<html>
<head>
<title> Ques 1 </title>
<link href="style2.css" rel="stylesheet" type="text/css">
</head>
<body onload="noBack();" onpageshow="if(event.persisted) noBack():" onunload="" ; onload="examTimer"
background= "coding5.gif">
<header>
<div class="row">
<div class = "logo">
<img src="logogame final.png">
</div>
<ul class="main-nav">
<div class="grid">
<li class="active"><a href="game1.html" > INSTRUCTIONS </a></li>
<li><a href=" "> Ques.1 </a></li>
<li> <a>Username</a></li>
<li><a> Progress bar</a></li>
<li><a>timer</a></li>
</div>
</ul>
</div>
</div>
<div class="headline">
<h1> <u> <br> Question 1 </u></h1>
</div>
</div>
<p> <br>
There are a number of plants in Asgard. Each of these plants has been treated with some amount of pesticide. After each day, if any plant has more pesticide than the plant on its left, being weaker than the left one, it dies.
You are given the initial values of the pesticide in each of the plants. Print the number of days after which no plant dies, i.e. the time after which there are no plants with more pesticide content than the
plant to their left.
<br>For example, pesticide levels . Using a -indexed array, day plants and die leaving . On day , plant of the current array dies leaving . As there is no plant with a higher concentration of pesticide than the one to its left, plants stop dying after day .
<br>Function Description
<br>Complete the function poisonousPlants in the editor below. It must return an integer representing the number of days until plants no longer die from pesticide.
poisonousPlants has the following parameter(s):
<br> p: an array of integers representing pesticide levels in each plant
<br>Input Format
<br>The first line contains an integer , the size of the array .
<br>The next line contains space-separated integers .
<form name= "myform" action=" " method="post">
<div>
<label for="Solution"> Enter Solution: <br></label>
<input type="text" name="Solution">
</div>
<div>
<input type="button" class="submit" value="Submit" onclick="myfunc ()">
</div>
</form> </p>
</header>
</body>
<script type="text/javascript">
window.history.forward();
function noBack() { window.history.forward(); }
window.onbeforeload = function() {return" Your work will be lost." ;};
function myfunc()
{
var a=document.myform.Solution.value;
if(a=="e")
{
alert(" You got it right " );
window.location.replace(" pass1.html ");
}
else
{
alert("You have entered an incorrect answer. Please try again." );
}
}
</script>
</html>