-
Notifications
You must be signed in to change notification settings - Fork 0
/
lab.html
602 lines (526 loc) · 20.7 KB
/
lab.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>Lab Solutions</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/lab.css" type="text/css" />
<script src="js/lab.js"></script>
</head>
<body>
<h1 class="title">Lab Solutions</h1>
<div class="navbar">
<a href="index.html">Home</a>
<a href="https://esp.sp.edu.sg/webapps/blackboard/content/listContent.jsp?course_id=_52437_1&content_id=_1475638_1&mode=reset">CSAD Module</a>
<div class="dropdown">
<button class="dropbtn" onclick="myFunction()">Labs ↓
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content" id="myDropdown">
<a href="#lab1">Lab 1</a>
<a href="#lab2">Lab 2</a>
<a href="#lab3">Lab 3</a>
</div>
</div>
</div>
<!---------------------------------------- Lab 1 ---------------------------------------------------------->
<h1 style="text-align:center; color:red" id="#lab1">Lab 1</h1>
<hr style="width:20%; color:red">
<h2 class="question">Q1</h2>
<div class="box">Welcome to our Website</div>
<h2 class="question">Q2</h2>
<div class="box">
<h1 align="left">Level 1</h1>
<h2 align="right">Level 2</h2>
<h3 align="center">Level 3</h3>
<h4 align="left">Level 4</h4>
<h5 align="left">Level 5</h5>
<h6 align="center">Level 6</h6>
</div>
<h2 class="question">Q3</h2>
<div class="box">
<h1 align="center">Nokia N70</h1>
<p>
If the Nokia N70 phone had a twin, it has to be the <u>6680</u>.
Not only do both phones share an almost similar design, they....
<b><i>Symbian Series 60</i></b> platform. Fortunately as with any upgrade
models, ... <b><u>2-megapixel</u></b> camera and an improved handset design.
</p>
<p>One question beckons. Can the N70 emulate the success of its predecessor?</p>
</div>
<h2 class="question">Q4</h2>
<div class="box"><img src = "img/iphone4.jpg" alt= "iphone 4"></div>
<h2 class="question">Q5</h2>
<div class="box">
<p>
Here are my favorite Internet search engines <br>
Click on the address to go to that page.
</p>
<p>
Yahoo: <a href="https://www.yahoo.com">https://www.yahoo.com</a> <br>
Searx: <a href="https://searx.xyz/">https://searx.xyz/</a>
</p>
</div>
<h2 class="question">Q6</h2>
<div class="box">
<p>
My email address is <a href="mailto: LeeKL@sp.edu.sg">LeeKL@sp.edu.sg</a>.
Click on the address and your browser will
open an email message and address it to me.
</p>
</div>
<h2 class="question">Q7</h2>
<div class="box">
<font style="font-family: Script; color:blue" size="+3">Nokia N70</font>
<p>
If the <span style="color:red">Nokia N70</span> phone had a twin,
it has to be the <font size="-2">6680</font>.
</p>
</div>
<h2 class="question">Q8</h2>
<div class="box">
<p>To insert a hyperlink on a webpage, you can use the <a> tag</p>
<p>The HTML code for producing the < sign is &lt;</p>
<p>The temperature today is 28°C.</p>
<p>All information on this site is © Michale Lee 2012.</p>
<p>No permission is needed if you only need to use ¼ of the information presented here.</p>
</div>
<h2 class="question">Q9</h2>
<div class="box">
There are 6 spaces between here and here.<br>
There are 12 spaces between here
and here.<br>
</div>
<h2 class="question-alt">Q10</h2>
<div class="box">
<hr width="90%">
<hr size="4" width="75%" color="#00ff00">
<hr size="12" width="100" color="Red">
<hr size="8" width="50%" noshade="noshade">
</div>
<h2 class="question-alt">Q11</h2>
<div class="box">
<h1>Unordered list</h1>
<ul>
<li>Singapore Poly</li>
<li>Ngee Ann Poly</li>
<li>Temasek Poly</li>
</ul>
<h1>Ordered list</h1>
<ol>
<li>Singapore Poly</li>
<li>Ngee Ann Poly</li>
<li>Temasek Poly</li>
</ol>
<h1>Unordered list</h1>
<ul type="circle">
<li>Singapore Poly</li>
<li>Ngee Ann Poly</li>
<li>Temasek Poly</li>
</ul>
<h1>Ordered list</h1>
<ol type="i">
<li>Singapore Poly</li>
<li>Ngee Ann Poly</li>
<li>Temasek Poly</li>
</ol>
</div>
<h2 class="question-alt">Q12</h2>
<div class="box">
<table border="1">
<tr>
<td>SP</td>
<td>Singapore Poly</td>
</tr>
<tr>
<td>SP</td>
<td>Singapore Poly</td>
</tr>
<tr>
<td>SP</td>
<td>Singapore Poly</td>
</tr>
</table>
</div>
<h2 class="question-alt">Q13</h2>
<div class="box">
<table border="1">
<tr><th colspan="2">Polys in SG</th></tr>
<tr>
<td>SP</td>
<td>Singapore Poly</td>
</tr>
<tr>
<td>SP</td>
<td>Singapore Poly</td>
</tr>
<tr>
<td>SP</td>
<td>Singapore Poly</td>
</tr>
</table>
</div>
<h2 class="question-alt">Q14</h2>
<div class="box">
<table border="1">
<tr>
<td>SP</td>
<td>Singapore Poly</td>
<td rowspan="3"><img src="img/merlion.jpg" alt="merlion pic"></td>
</tr>
<tr>
<td>SP</td>
<td>Singapore Poly</td>
</tr>
<tr>
<td>SP</td>
<td>Singapore Poly</td>
</tr>
</table>
</div>
<h2 class="question-alt">Q15</h2>
<div class="box">
<table border="1" width="80%" bgcolor="pink" cellspacing="5" cellpadding="10">
<tr>
<td width="400px" bgcolor="red">SP</td>
<td>Singapore Poly</td>
</tr>
<tr>
<td>SP</td>
<td>Singapore Poly</td>
</tr>
<tr>
<td bgcolor="yellow">SP</td>
<td bgcolor="yellow">Singapore Poly</td>
</tr>
</table>
</div>
<h2 class="question-alt">Q16</h2>
<div class="box">
<table bgcolor="#7f7f7f" border="1" cellpadding="5" cellspacing="10" width="500">
<tr bgcolor="#ffbecb">
<td colspan="3">Blah</td>
<td width="300">Blah</td>
</tr>
<tr>
<td rowspan="2">Blah</td>
<td>Blah</td>
<td>Blah</td>
<td>Blah</td>
</tr>
<tr>
<td>Blah</td>
<td>Blah</td>
<td>Blah</td>
</tr>
<tr>
<td>Blah</td>
<td rowspan="2" colspan="2" bgcolor="#fdb017">Blah</td>
<td>Blah</td>
</tr>
<tr>
<td>Blah</td>
<td>Blah</td>
</tr>
</table>
</div>
<h2 class="question-alt">Q17</h2>
<div class="box">
<form method="post">
Name: <input value="Pls type your name" name="name" type="text"> <br>
Password: <input name="password" type="password"> <br>
Year:
<select name="year">
<option value="year1" selected="selected">Year 1</option>
<option value="year2">Year 2</option>
<option value="year3">Year 3</option>
</select> <br>
Gender:
<input value="M" name="gender" type="radio">Male
<input value="F" name="gender" checked="checked" type="radio">Female <br>
Comments: <textarea rows="5" cols="50">Pls type your comments here.</textarea> <br>
<input value="Go" type="submit">
</form>
</div>
<h2 class="question-alt">Q18</h2>
<div class="box" style="color: blue; background-image: url(img/bg.gif);">
<p alink="purple" link="green" vlink="orange">
Click <a href="https://github.com/iv-org/invidious/">here</a> for YouTube with no Ads.
</p>
</div>
<h1 style="text-align:center; color:red" id="lab2">Lab 2</h1>
<hr style="width:20%; color:red">
<!-------------------------------------------- Lab 2 ------------------------------------------------------->
<div class="box" id="lab2-q1">
<h2 class="question-alt">Q1</h2>
CSS Page Background and Text Color
</div>
<div class="box" id="lab2-q2-bod">
<h2 class="question">Q2</h2>
<h1>HTML</h1>
<h2 id="lab2-q2-h2">CSS</h2>
</div>
<div class="box box2">
<h2 class="question">Q3</h2>
<h1 id="dicd">DICD</h1>
<h2 id="icd">ICD</h2>
<h3 id="css">CSS</h3>
</div>
<div class="box box2">
<h2 class="question">Q4</h2>
<p style="font-family: Comic Sans MS;font-size: 15pt">Line 1</p>
<p class="style1">Line 2</p>
<p class="style2">Line 3</p>
</div>
<div class="box box2">
<h2 class="question">Q5</h2>
<p>Line 1</p>
<p class="blue">Line 2</p>
<h1 id="header">Line 3</h1>
<p class="blue">Line 4</p>
<p>Line 5</p>
<p class="blue">Line 6</p>
</div>
<div class="box box2">
<h2 class="question">Q6</h2>
<h3>Table 1</h3>
<table class="table">
<tr class="c1">
<td class="data">My favourite food</th>
<td class="data">Roti Prata</td>
</tr>
<tr class="c2">
<td class="data">My favourite drink</td>
<td class="data">Coke</td>
</tr>
</table>
<h3>Table 2</h3>
<table class="table">
<tr>
<td class="c1">My favourite movie</th>
<td class="c1">Lord of the Rings</td>
</tr>
<tr>
<td class="c2">My favourite book</td>
<td class="c2">Da vinci code</td>
</tr>
</table>
</div>
<div class="box box2">
<h2 class="question">Q7</h2>
<h1>Male Artistes</h1>
<ul class="pointer1">
<li>Tom Cruise</li>
<li>Brad Pitt</li>
<li>Leonardo DiCaprio</li>
</ul>
<h1>Female Artistes</h1>
<ul class="pointer2">
<li>Angelia Jolie</li>
<li>Cameron Diaz</li>
<li>Jennifer Love Hewitt</li>
</ul>
</div>
<div class="box box2">
<h2 class="question">Q8</h2>
<div class = "div1">
Division 1<p/>Division 1<p/>Division 1<p/>
Division 1<p/>Division 1<p/>Division 1<p/>
Division 1<p/>Division 1<p/>Division<p/>
</div>
<div class = "div2">
Division 2<p/>Division 2<p/>Division 2<p/>
Division 2<p/>Division 2<p/>Division 2<p/>
Division 2<p/>Division 2<p/>Division 2<p/>
</div>
</div>
<div class="box box2">
<h2 class="question">Q9</h2>
<p class="q9link">Click <a href="home.html">here</a> to visit my webpage</a></p>
</div>
<div class="box box2">
<h2 class="question-alt">Q10</h2>
<br>
<span style="font-size:50pt; z-index:0; left:150; top:30; color:green; position:relative;">Above</span>
<span style="font-size:50pt; z-index:-2; left:170; top:50; color:blue;position:relative;">Below</span>
<img src="img/Lab2/apple.gif" style="z-index:-1; position:relative;">
</div>
<h1 style="text-align:center; color:red" id="lab3">Lab 3</h1>
<hr style="width:20%; color:red">
<!-------------------------------------------- Lab 3 ------------------------------------------------------->
<div class="box" id="lab2-q1">
<h2 class="question-alt" >Q1</h2>
<br>
<svg height="210" width="300">
<polygon points="10,10 15,190 160,210" style="fill:white;stroke:purple;stroke-width:1" />
</svg>
<br>
<script>
var base = 5;
var width = 6;
var height = 7;
var area = 1/2 * base * height;
document.write("Area of the triangle: ", area);
</script>
</div>
<div class="box" id="lab3-q2">
<h2 class="question">Q2</h2>
<br>
<script>
for(var i = 0; i != 16; ++i) {
if (i%2 == 0)
document.write(i, " is even <br>");
else
document.write(i, " is odd <br>");
}
</script>
</div>
<div class="box box2">
<h2 class="question-alt">Q3</h2>
<br>
<script>
for(var i = 0; i != 16; i+=2){
document.write(i ," * ", i ," = ", i*i, "<br>");
}
</script>
</div>
<div class="box box2">
<h2 class="question-alt">Q4</h2>
<table>
<tr>
<th><u>Range</u></th>
<th><u>Grade</u></th>
</tr>
<tr>
<td>0 to 49</td>
<td>F</td>
</tr>
<tr>
<td>50 to 59</td>
<td>D</td>
</tr>
<tr>
<td>60 to 69</td>
<td>C</td>
</tr>
<tr>
<td>70 to 79</td>
<td>B</td>
</tr>
<tr>
<td>80 to 100</td>
<td>A</td>
</tr>
</table>
<br>
<script>
let marks = [80, 77, 88, 95, 68];
avgMark(marks);
</script>
</div>
<div class="box box2">
<h2 class="question-alt">Q5</h2>
<p>
Create a new html file and name it “Q5.html”. <br>
Write <b>two</b> JavaScript <b>functions</b> which each will take an input parameter of an array of <br>
numbers stored and find the smallest and largest number respectively. By calling the two <br>
functions, compute and display the smallest and largest number of the array [80, 77, 88, 95, <br>
68].
</p>
<script>
let numbers = [80, 77, 88, 95, 68];
findSmall(numbers);
findBig(numbers);
</script>
</div>
<div class="box box2">
<h2 class="question-alt">Q6</h2>
<br>
<script>
findWord("AA", "AA BB CC AA DD");
</script>
</div>
<div class="box box2">
<h2 class="question-alt">Q7</h2>
<h2>An Extremely simple Calculator</h2>
<form>
Input 1st number : <input type="text" id="firstNumber" /> <br>
Input 2nd number : <input type="text" id="secondNumber" /> <br>
<input type="button" onclick="add()" value="Addition"/>
<input type="button" onclick="subtract()" value="Subtraction"/>
<input type="button" onclick="multiply()" value="Multiply"/>
<input type="button" onclick="divide()" value="Divide"/>
</form>
<p>
Result : <span id="result">____</span>
</p>
</div>
<div class="box box2">
<h2 class="question-alt">Q8</h2>
<form>
Quantity <br>
<input type="number" min="1" value="1" id="quantity" /> <br>
Price Per Unit ($) <br>
<input type="number" step="any" value="1.00" id="ppu" /> <br>
Tax rate (%) <br>
<input type="number" step="any" value ="7.0" id="tax" /> <br>
Discount (%) <br>
<input type="number" step="any" id="discount" value="0.00"/> <br>
Total ($) <br>
<input type="number" step="any" id="total" /> <br>
<input type="button" onclick="calPricing()" value="Calculate"/>
</form>
</div>
<div class="box box2">
<h2 class="question-alt">Q9 </h2>
<form name="SurveryFrom" onsubmit="return validateInputs()">
<p>Name: <input type="text" size="35" name="Name"></p>
<p>Email: <input type="text" size="35" name="Email"></p>
<p>Age: <input type="text" name="Age"></p>
<p>
Course
<select name="Course">
<option value="0">SELECT COURSE</option>
<option value="1">DEEE</option>
<option value="2">DCPE</option>
<option value="3">DASE</option>
<option value="4">DEB</option>
</select>
</p>
<p>
<input type="submit" value="Send" name="Submit">
<input type="reset" value="Reset" name="Reset">
</p>
</form>
</div>
<div class="box box2">
<h2 class="question-alt">Q10</h2>
<table id="table">
<tr>
<td>User ID:</td>
<td><input type="text" id="uid" onkeyup="validateUserID();"/></td>
<td><div id="errUid"></div></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" id="password"
onkeyup="validatePassword();"/></td>
<td><div id="errPassword"></div></td>
</tr>
</table>
<br>
<table>
<tr>
<td><input type="button" id="login" value="login"
onclick="validate(); finalValidate();"/></td>
<td><div id="errFinal"></div></td>
</tr>
</table>
</div>
</body>
</html>