-
Notifications
You must be signed in to change notification settings - Fork 0
/
BestSinger.html
150 lines (112 loc) · 3.09 KB
/
BestSinger.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Best Singers</title>
<style>
body {
background-color:#f4dc42;
}
#average{
font-size:150%;
font-family:Arial, Helvetica, sans-serif;
}
h1{
font-size:200%
font-family:Arial, Helvetica, sans-serif;
}
</style>
<script type = "text/javascript">
function upload_picture(input)
{
var img = document.getElementById("committee"+input.id);
var str =input.value.split('\\');
var filename = str[str.length-1];
img.src="C:\\committees\\"+filename;
}
function calcAvg()
{
var score;
var min=document.getElementById("score1").value;
var max=document.getElementById("score1").value;
var sum=0;
var avg = document.getElementById("average");
for(var i =1 ; i<6;i++)
{
score=parseInt(document.getElementById("score"+i).value);
sum+=score;
if(min>score)
min=score;
if(max<score)
max=score;
}
sum=sum-min-max;
avg.innerHTML="The max score is "+max+"<br/>";
avg.innerHTML+="The min score is "+min+"<br/>";
avg.innerHTML+="The average score by taking off max and min is "+ sum/3.0 ;
}
</script>
</head>
<body>
<div style="position: absolute; left: 500px; top: 28px; width: 222px; height: 76px;">
<h1>Best Singer</h1>
</div>
<div style="position: absolute; left: 100px; top: 100px;">
<p>Committee1</p>
<p><img id="committee1" src="" width="101" height="129" alt=""> </p>
<p>
<input type="file" id="1" onchange="upload_picture(this)">
</p>
<p>
<input type="textfiled" id="score1" size="5" >
</p>
</div>
<div style="position: absolute; left: 300px; top: 100px;">
<p>Committee2</p>
<p><img id="committee2" src="" width="101" height="129" alt=""> </p>
<p>
<input type="file" id="2" onchange="upload_picture(this)">
</p>
<p>
<input type="textfiled" id="score2" size="5" >
</p>
</div>
<div style="position: absolute; left: 500px; top: 100px;">
<p>Committee3</p>
<p><img id="committee3" src="" width="101" height="129" alt=""> </p>
<p>
<input type="file" id="3" onchange="upload_picture(this)">
</p>
<p>
<input type="textfiled" id="score3" size="5">
</p>
</div>
<div style="position: absolute; left: 700px; top: 100px;">
<p>Committee4</p>
<p><img id="committee4" src="" width="101" height="129" alt=""> </p>
<p>
<input type="file" id="4" onchange="upload_picture(this)">
</p>
<p>
<input type="textfiled" id="score4" size="5">
</p>
</div>
<div style="position: absolute; left: 900px; top: 100px;">
<p>Committee5</p>
<p><img id="committee5" src="" width="101" height="129" alt=""> </p>
<p>
<input type="file" id="5" onchange="upload_picture(this)">
</p>
<p>
<input type="textfiled" id="score5" size="5">
</p>
</div>
<div style="position: absolute; left: 519px; top: 431px; width: 60px; height: 24px;">
<button onClick="calcAvg()">Submit</button>
</div>
<div style="position: absolute; left: 113px; top: 487px; width: 901px; height: 72px;">
<p id="average" >
</p>
</div>
</body>
</html>