Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Iii. Web App Answers

Download as pdf or txt
Download as pdf or txt
You are on page 1of 55

BASKAR Lec.

in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

WEB APPLICATIONS – ANSWERS


1. The first release of Windows Movie Maker was included with (a) Windows ME in the year 2000.
2. The statement that is not true about Blender Software is (b) Huge amount of money is
required to buy its license. Blender is an open-source software and is free to use.
3. The default view in Windows Movie Maker is (b) Storyboard.
4. The option that is not an advantage of using multimedia on a webpage is (d) Longer loading
times.
5. PDF stands for (b) Portable Document Format.
6. c. MIDI is a program that acts as a go-between for an instrument and something that creates
sound.
7. c. Multimedia is the media that uses multiple forms of information content and information
processing to inform or entertain the user.
8. The option that is not a valid extension of video files is c. .mp3.
9. In Windows Movie Maker, ‘Publish Movie’ option is available under (a) File menu.
10. Suyash has written the following code to play a sound file in the web browser. Complete the code
by using appropriate attribute and value in the given code so that the audio controls are not
visible on the webpage.
HTML
<EMBED SRC="he-knows.mp3" HIDDEN="true" AUTOSTART="true" LOOP="infinite"
Height=145 width=160></EMBED>
11. BGSOUND tag works only in (b) IE and not in any other browser.
12. The type of the media player from the given value of type attribute of <object> tag is (a)
Windows Media Player.
13. MixPod creates a/an (a) free flash widget to embed into our site.
14. (b) Yahoo Media Player auto-detects links to MP3 files in our web pages and creates an
embedded player for each link.
15. In Windows Movie Maker, we can import several video clips at once. For consecutive clips, click
the first video clip in the list, press and hold down the (b) SHIFT key and then click the last clip
in the list.
16. A (a) raster image consists of a field of pixels and is usually created using MS Paint/scanning
images etc.
17. JavaScript is a/an (b) interpreted computer programming language.
18. Complete the following JavaScript code given below to import external JavaScript file “hello.js” in
the program.
HTML
<script type="text/javascript" src="hello.js"></script>
19. Write a statement in JavaScript to declare a variable num1 and initialize it with value 10+20.
JavaScript
var num1 = 10 + 20;
20. Write the equivalent expression in JavaScript for the following:
JavaScript
b = (1 / 2) * (50 + 70); So, the value of ( b ) is ( 60 ).
21. What will be the output of the following JavaScript code?
JavaScript
var k = [1, 2, 3];
k[20] = 21;
document.write(k.length);
The output will be (b) 21.
22. How many times will the following loop run?
JavaScript
while (true) {
document.write("hello");
}
The loop will run infinitely.

1
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

23. JavaScript objects are simply collections of name-value pairs where the name part is a
JavaScript (b) expression.
24. Output: The function mFun adds x, y, and NaN. Since any operation involving NaN results in NaN,
the output will be NaN.
25. A c. data type is a classification of the type of data that a variable or object can hold.
26. PSD stands for Photoshop Document.
27. Snippets can be inserted only in split or code view.
28. Which of the following is not a scripting language? d. Basic
29. IntelliSense feature automatically provides a list of codes and attributes as a popup when you
work in the a. Code View mode.
30. Details collected from a form are saved in a b. Database with corresponding fields.
31. DWT Full Form is Dynamic Web Template
32. KompoZer and Dreamweaver are c. Web authoring tools.
33. JavaScript users can get and set properties of an object using the dot (.) or bracket ([])
operator.
34. Search engines crawl a website and hence are referred to as spiders.
35. Math.round(-20.51) results in -21.
36. If A = 10 and B = 25, the output of A && B is TRUE because both A and B are non-zero values.
37. An example of a loop in JavaScript is do-while.
38. JavaScript variables are “containers” for storing information.
39. JavaScript was developed by Brendan Eich.
40. Document Object Model - DOM stands for Document Object Model.
41. Variables in JavaScript can be declared using var.
42. % in JavaScript is an example of an arithmetic operator.
43. Numbers in JavaScript are double-precision 64-bit format.
44. The extension that identifies a picture file is .png.
45. A comparison operator in JavaScript is ==.
46. Search engines search contents of a web page and create indexes to display results.
47. The Collection Pane displays our collection folders, which contain clips.
48. AVI stands for Audio Video Interleaved.
49. The playback indicator can be dragged on the seek bar to the exact spot where you want to split
the clip.
50. a. View - The preview monitor can be made larger or smaller by clicking View.
51. The extension that identifies a video file is .avi.
52. We can upload a file to a web server using a protocol called FTP.
53. The object tag conforms to the W3 standard and helps to achieve standardization across the
World Wide Web.
54. A JavaScript arithmetic operator is %.
55. To use random() in JavaScript, the syntax is Math.random().
56. The output of the JavaScript code var name=["Red", "Blue", "Yellow", "Green"];
name.pop() will be “Green”.
57. In JavaScript, if a variable is defined using var in a compound statement “if”, it will be visible to
the entire compound “if” statement.
58. To use an object’s methods or properties, we write the object’s name, a dot (.), and then the
method/property name.
59. Multimedia refers to any type of application or presentation that involves more than one type
of media, such as text, graphics, video, animation, and sound.
60. A smaller version of an image is called a thumbnail.
61. Web publishing means publishing the web pages.
62. (iv) All of the above - JavaScript is used for client-side applications, data validation, and
creating interactive forms.
63. (i) By adding text-based information to your movie - Titles and credits let you enhance your
movie by adding text-based information.
64. (i) Quality of traffic - SEO is used to improve the volume and quality of traffic to a website from
search engines.
2
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

65. The term “Sandbox” in SEO refers to (ii) This is where sites are kept till they get mature
enough to be included in the top rankings for a particular keyword -
66. (a) Press and hold Ctrl key while selecting clips - To select non-consecutive clips in Windows
Movie Maker/Video Editor.
67. A raster image format is composed of a field of pixels, each characterized by a color.
68. varTxt.toUpperCase() - This statement will display the string in uppercase.
69. No - .avi is not an image file format; it is a video file format.
70. The inbuilt JavaScript function that can be used to join the two arrays is concat(). Example: var
combined = fruits.concat(vegetables);.
71. View > Site > Size - To know the size occupied by files in a website, open the website and select
View > Site > Size.
72. The name of actors is ideally displayed at the end as credits.
73. The extension of a standard Macintosh image file is .pict.
74. The <BGSOUND> tag can be used only in Internet Explorer to include an audio file.
75. The FTP feature is used to transfer contents of your entire website to a remote computer.
76. If a variable is declared without assigning any value, its type (datatype) is undefined.
77. Consistency - One advantage of DWT (Dynamic Web Template) is that it ensures consistency
across multiple web pages.
78. SEO (Search Engine Optimization) - SEO is the process that affects the website visibility or
ranking while displaying search results.
79. The Preview Monitor is the area of Windows Movie Maker which enables you to view
individual clips or the entire project before publishing it as a movie.
80. Google -is a popular search engine.
81. GIF is a lossless image format.
82. The output of the code snippet document.write(Math.round(5.319)) is 5.
83. isFinite() in JavaScript is used to determine whether a value is a finite number. It returns true if
the value is finite, and false if the value is NaN, Infinity, or -Infinity.
84. One desktop publishing program is Adobe InDesign.
85. The Collections pane in Windows Movie Maker displays the folders containing clips.
86. True - The term “rich media” is synonymous with interactive multimedia.
87. The output of the JavaScript statements will be “Hi” because both conditions (A > B) and (B >
C) are true.
88. One video streaming application that allows video embedment is YouTube.
89. The method in JavaScript that allows joining all elements of an array into a string is join().
90. One Page Transition effect that can be used on web pages is Fade.
91. NaN + 5 results in NaN.
92. b. List is not a valid datatype in JavaScript.
93. c. .mp3 is an example of an audio file.
94. The Zoom Timeline appears as a magnifying glass with a (+) sign in it.
95. The Document object uses the write() method to output some text to the page-document.
96. The output of the JavaScript statement parseInt("345", 10) is 345.
97. a. pop() method in JavaScript removes and returns the last item.
98. Two functions associated with Stack in JavaScript are push() and pop().
99. The function used to find the length of a given string in JavaScript is length.
100. Ramesh can use the typeof command/function in JavaScript to find the datatype of the
variable.
101. The type of attribute in the <script> tag specifies the scripting language of the script. For
example, type="text/javascript".
102. Logical - && is a type of logical operator in JavaScript.
103. The output of the code NaN + 5 is NaN.
104. A statement in JavaScript to declare a variable ‘Sum’ and initialize it with 10 is:
JavaScript
var Sum = 10;
105. for (var i=0; i<=5; i++)
{ ……..
3
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

}
The loop will run 6 times.
106. Examples of two logical operators are && (AND) and || (OR).
107. IntelliSense is a code-completion aid that includes a number of features: List Members,
Parameter Info, Quick Info, and Complete Word.
108. IIS stands for Internet Information Services.
109. Information collected from web-based forms can be stored in a database with appropriate
fields for every entry in the form.
110. b) 32-bit and 64-bit - Virtual Dub is a video capture/processing utility for 32-bit and 64-bit
Windows platforms.
111. b) ZS4 video Editor - ZS4 video Editor aims to provide media experts with a facility to
combine a variety of media types into one or more output files.
112. a) General Public License - All open-source software(s) are available under GNU General
Public License.
113. c) Wax - Wax can work in two modes - as a standalone application and as a plug-in.
114. d) Avidemux - Avidemux is the video editing software in which tasks can be automated
using projects, job queue, and powerful scripting.
115. c) Both i) and ii) are correct - Both statements about Moviestorm are correct.
116. i) V-Dub is not primarily an AVI editor - This statement is correct.
117. The false statement is i) VideoSpin is an image processing software1.
118. b) AVI Trimmer - AVI Trimmer is a free video editor for fast and lossless AVI editing.
119. a) preview monitor - The preview monitor enables us to view individual clips or an entire
project before publishing it as a movie in Windows Movie Maker.
120. b) Easy HTML5 Video - Easy HTML5 Video is developed to convert videos into HTML5
supported WebM, MP4, and OGG formats.
121. b) MixPod - MixPod creates a free flash widget to embed into our site.
122. c) ii) and iii) correct - The appropriate options to embed the file ‘music.wav’ in the web
page with width 100 pixels and height 200 pixels using the object tag are:
HTML
<object data="music.wav" type="audio/x-mplayer2" width="100" height="200">
<object src="music.wav" type="audio/x-mplayer2" width="100" height="200">
123. ii) Motion Picture Experts Group - MPEG stands for Motion Picture Experts Group.
124. FLC is an Autodesk Flick movie and is a raw, uncompressed series of frames.
125. The file format of an audio file is .mid.
126. EPSI stands for Encapsulated Post Script with preview image.
127. The vector image file format from the following is .ps.
128. A .epsi file can be either raster or vector depending on the program that created it.
129. The correct sequence of steps to embed Flash video in Dreamweaver is Insert -> Media –
> Flash.
130. The tags used to add audio files to a webpage is <embed> and <object>
131. Quick Media Converter is another Windows-based converter for audio and video.
132. ECMA is an international standard organization for information and communication
systems.
133. Image transfer is not a feature of a movie editing tool.
134. Virtual Dub is a video capture/processing utility for 32-bit and 64-bit Windows
platforms.
135. Cinefx is an offline playback, editing, encoding, animation, and visual effects tool based on
the Jahshaka technology.
136. Blender is the free open-source 3D content creation suite, available for all major operating
systems under the GNU General Public License.
137. Moviestorm is the complete 3D movie-making software application for all abilities.
138. Multimedia is the media that uses multiple forms of information content and information
processing.
139. The term “rich media” is synonymous with interactive multimedia.
140. The most common way to discover the type of a file is to look at the file extension.
4
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

141. swf, .wav, .mp3, and .mp4 are examples of movie/multimedia files.
142. A raster image is one composed of a field of pixels, each characterized by a color, and is
usually created in paint programs.
143. GIF is an example of a lossless image file format.
144. A Pict file is a standard Macintosh image file format and can be either a raster image or a
vector image, depending on the program that created it.
145. MIDI is an acronym for Musical Instrument Digital Interface.
146. Video LightBox is a wizard program for Windows and Mac that helps users easily insert
video to the website or blog, in a few clicks without writing a single line of code.
147. The <object> tag is the web standard for embedding content onto a web page.
148. The correct sequence of steps to split a movie is: c) 4) -> 3) -> 2) -> 5) -> 1)
149. b) 2-A, 1-C, 3-B
The correct option is:
1 Task Pane - C lists the common tasks.
2 Timeline - A Provides a more detailed view of the movie.
3 DVD Knife - B The clips will be stored in VOB format only.
150. c) ii) is correct - Lossy formats lose resolution (sharpness) when converted to, while
lossless formats preserve image information.
i)- B, ii)- C, iii) - A - The correct match is:
i) Sound File - B .qt (Quick Time)
ii) Flash File - C .swf
iii) multimedia - A Multiple forms of media
151. The correct option is c) Both 1 and 2 are correct.
✓ A MIDI file works over the web as a program that runs the sound card.
✓ A MIDI file is not simply read and reproduced like a .wav or an .au file. Instead, it tells the
sound card what note to produce and for what duration
152. Identify the type of operators:
i) *, /, + - Arithmetic operators
ii) >>, >>> Bitwise operators
iii) <, >=, >, == Comparison operators
153. b. Stress is a state of feeling upset, annoyed, and hopeless:
154. Reeta keeps detached and aloof, and is prone to introspection and fantasy. She shows little
interest in forming personal relationships and seems to be emotionally cold. Identify the
type of personality disorder: Schizoid Personality Disorder
155. Virtual Dub lacks Editing power of a general-purpose editor:
156. While creating a movie, credits should be added at the End of a movie:
157. Free Studio a single package which bundles all free software from DVD Video Soft to
work with DVD:
158. .PS image files are PostScript graphics file format:
159. An FLC is an Autodesk Flick movie and is a : b. raw, Uncompressed series of frames
160. Krishh has written the following code to display an object with the name “controller”. His
senior has instructed him to rewrite the code so that the object controller is not displayed
in the browser: HTML <param name="controller" value="false" />
161. Only d. Microsoft Internet Explorer supports the <object> tag for sound:
162. Name the default view in Movie Maker: Storyboard
163. c. Wax can create 2D & 3D special effects and can work in two modes – as a standalone
application and as a “plug-in”:
164. Give examples of any two multimedia elements: Text and Images
165. Brij wants to run the sound file again and again forever. Which of the following attributes of
the Embed command should be set to True to do so: c. Loop
166. The new <video> tag in HTML5 markup allows web developers to add videos into a web
page without any special plugins:
167. If we don’t want to outsource video hosting to third-party websites, it’s possible to make a
video web-ready with the help of Freemake Video Converter from Freemake.com:
168. Free Video Coding is an online service that helps us to create a b. web video player
5
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

169. Windows Movie Maker is a feature of a. Windows Vista that enables us to create home
movies and slide shows on our computer, complete with professional-looking titles,
transitions, effects, music, and even narration:
170. b. Video LightBox is a wizard program for Windows and Mac that helps users easily insert
video to the website or blog, in a few clicks without writing a single line of code:
171. VirtualDub has capabilities for processing large numbers of files and
can be extended with third-party video filters. True/false: b. batch processing
172. WAX can create 2D & 3D special effects and can work in two modes – as a standalone
application for home users/beginners, and as a “plug-in” to video editors/NLEs for
professional editors.
173. Select the appropriate video editing tools that can capture video by a number of ways,
including one-frame-per-minute (web camera. option, workaround 2 GB file size limit, send
the videos to printer, heavy compress it and post to the webpage. c. AVIedit.
174. c. DVDKnife is the simplest and fastest tool in its category with the ability to extract long
VOB clips in a few seconds.
175. In Movie Maker, we can drag clips, transitions, or effects from the Content Pane. The option
not seen in the Content Pane of Windows Movie Maker is: c. folders.
176. The acronym AVI stands for Audio Video Interleave.
177. The statement that is not true about multimedia is: c. Multimedia is similar to traditional
media like fine art.
178. Search engines crawl a website and hence are referred to as spiders or web crawlers.
179. Search engines index various components of a web page. Two components are: Title tags
and Meta descriptions
180. The term SEO stands for Search Engine Optimization.
181. One method used by web hosting providers to upload a website is FTP (File Transfer
Protocol).
182. Once a website is published, it is available d. 24X7 (all the time) for its visitors to view.
183. Two web authoring tools are Adobe Dreamweaver, Microsoft Word
184. The file “Solarenergy.mp3” is a multimedia file.
185. The option that is not a web browser is: c. EPS.
186. GIF is a lossless image file format, while JPEG is a lossy image file format.
187. Movies consist of a series of b. still images, sometimes with embedded audio information.
188. The program over the web that runs a sound card is: a. midi file.
189. .cgm (Computer Graphic Metafile) is an example of a Vector graphic.
190. Free Video Coding is an online service that helps us to create a b. web video player.
191. SEO (Search Engine Optimization) refers to the process that affects the website visibility
or ranking when displaying search results.
192. d. Link with Source. Is the feature of MEW used to update the image whenever the original
image is updated.
193. While designing a web page, a proper balance must be maintained between: b. visual
design and code.
194. In order to have fixed positions for common elements and modifiable designated portions on
each web page, one can use: b. Dynamic Web Template.
195. Every form should have a c. submit button to input the data entered in a form to the server.
196. Description can be added to a web page using b. META tags.
197. True. Movica will work with .wmv, flv, rm, and .mpg files, making it more versatile than
VirtualDub.
198. Which of the following is not movie editing software? JavaScript and HTML
a. DVD Knife is a simple tool for extracting DVD clips from DVDs. The clips are stored only
in VOB format.
b. AVI Trimmer is a free video editor for fast and lossless AVI editing.
c. JPEG stands for Joint photographic experts group
d. Files with .voc extension are the Sound files.
e. Each video on Facebook has an id which shown in the URL or Uniform Resource
Locator.
6
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

199. c) Storyboard can be used to look at the sequence or the ordering of the clip in your project
and easily rearrange them.
200. PDF stands for d. Portable Document Format.
201. +“42” will produce the following output: (b)42
202. A file with extension .mp4 can contain just sound and no video.
203. a) Zwei-Stein Video Editor is a freeware non-linear, non-destructive video compositing and
editing system.
204. The conditional operator is: d) ?:
205. The option that is not a web browser is: d) Photoshop.
206. .avi is a file extension for (a) Video files1.
207. To import consecutive clips in Movie Maker, click the first video clip in the list, press and
hold down the CTRL key.
208. Application software that handles the post-production video editing of digital video
sequences on a computer are called video editing software.
209. VirtualDub is a video capture/processing software, licensed under (b) GPL.
210. Cinefx is an offline playback, editing, encoding, animation, and visual effects tool based on
the Jahshaka technology.
211. The software meant for editing the kind of movies that Virtual Dub cannot is Adobe
Premiere Pro.
212. XML stands for (b) Extensible Markup Language.
213. .gif, .tga, .ps are examples of (c) image files.
214. MIDI stands for (d) Musical Instrument Digital Interface.
215. True. VirtualDub has batch processing capabilities for processing large numbers of files and
can be extended with third-party video filters.
216. The ii) Task Pane lists the common tasks that may be needed to perform while making a
movie, including importing files, editing, and publishing the movie.
217. The default view of Windows Movie Maker is Storyboard.
218. Movie Editing tools are editing software and are also known as application software which
handle the post-production video editing of digital videos.
219. Anaam Hashmi expressed concerns about the negative impact of multimedia on the web.
220. A lossless image file format is PNG.
221. SEO stands for Search Engine Optimization.
222. d. Tasks Pane lists the common tasks that may be needed to perform while making a movie,
including importing files, editing, and publishing the movie.
223. NLE stands for b. Non Linear Editing.
224. c. Blender is a free open-source 3D content creation suite available under GNU license
225. c. Animation can be considered as multimedia.
226. The extension that identifies a webpage is a. .html.
227. c. Movie Storm is the complete 3D movie-making software application for all abilities and it
allows creating excellent animation effects.
228. Atomic Learning’s Video Editor is a free movie editing tool designed to give teachers and
students the ability to enter short titles and descriptions, complete with planned length and
edited order.
229. A file with an extension .jpeg indicates that it is an image file.
230. Vector is a type of image format that does not consist of pixels, but objects such as curves,
shades, and characters.
231. The type of operator in the statement a != b is: b. Comparison.
232. On execution of the code <param name = "controller" value = "False"/>, the object controller
is not displayed in the browser.
233. During web designing, in Design mode, the IntelliSense feature provides you a list of codes
and attributes as a pop-up.
234. a. Preview Monitor enables us to view individual clips or an entire project in Windows
Movie Maker.
235. AVI stands for b. Audio Video Interleaved.
236. Movie editing tools are editing software and an example of c. Application Software.
7
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

237. The option that cannot be considered as multimedia is: a. Plain Text.
238. The extension that identifies a style sheet file is: b. .css.
239. The process of tweening in animation is similar to the video concept of in-betweening.
240. The movies that rely upon computer animation for all of their images are: d. All of the
above (The Incredibles, Shrek, Toy Story).
241. For non-linear video editing, video and audio clips are stored on: d. Hard Disk.
242. The least expensive way to solve the problem of storage space for short digital movies is: b.
Use data compression.
243. The reason for MP3 being a popular format for music file sharing is: c. MP3 compression
reduces file sizes considerably with minimal loss of music quality.
244. iii. Storyboard is the default view in Windows Movie Maker.
245. WMV stands for iv. Windows Media Video.
246. (i) DVD Knife is a simple tool to extract long VOB clips in a few seconds.
247. The WHAM program can be used (iv) To play sound files.
248. SEO (Search Engine Optimization) refers to the process that affects the website visibility
or ranking when displaying search results.
249. The feature of MEW used to update the image whenever the original image is updated is: d.
Link with Source.
250. While designing a web page, a proper balance must be maintained between: b. visual
design and code.
251. In order to have fixed positions for common elements and modifiable designated portions on
each web page, one can use: b. Dynamic Web Template.
252. Every form should have submit button to input the data entered in a form to the server.
253. Description can be added to a web page using b. META tags.
254. Variables in Java Script can be defined using var keyword.
255. A data type is a classification of the type of data that a variable or object can hold.
256. Numbers in Java Script are in double precision 64-bit format.
257. There is a built in object called Math to handle more advanced mathematical functions and
constants in JavaScript.
258. Bitwise NOT operator operates by reversing all bits in the opened.
259. The statement that is false with respect to JavaScript is: a. JavaScript is Object Oriented
programming language.
260. In JavaScript, objects are just collections of b) Name-value pairs.
261. DOM stands for b) Document Object Model.
262. The c) <script> tag alerts the browser about the scripting language JavaScript.
263. d) Relational Operators are examples of !=, <, >, >=.
264. The incorrect statement is: b. JavaScript can do some processing of forms but cannot
validate user input when the user submits the form.
265. The output of the following code:
JavaScript
<script type="text/javascript">
document.write("<i>Hello World!</i>");
</script>
is: c) Hello World!
266. The correct statements about Windows Movie Maker are: d) i), ii) and iv) are correct.
267. The extension of JavaScript files is: b) .js.
268. c) >>> is called the Bitwise Shift Right with Zero Operator, where the bits shifted in on the
left are always zero.
269. c) parseInt() is used to convert a string to an integer.
270. The output of parseInt("011", 8) would be: b) 9.
271. The extension for Photoshop files is: c) .psd.
272. a) Page Transition are the special effects that can be applied to a web page just like any
presentation software.
273. DWT stands for: c) Dynamic Web Template.
274. The correct option is: c) Both statements are correct.
8
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

275. SEO stands for: c) Search Engine Optimization.


276. JavaScript allows reusability feature by calling a function with an arbitrary array of
arguments, using the apply() method of any function object.
277. DOM stands for Document Object Model.
278. The output of the following code snippet:
JavaScript
document.write(Math.round(8.789)); is: 9.
279. The output of the code snippet document.write(isFinite(Infinity)); is false.
The isFinite function returns false for Infinity.
280. NaN stands for Not-a-Number.
281. The typeof operator in JavaScript tells the data type of a variable.
282. The output of the following code snippet:
JavaScript
<script>
x = 42 % 2;
switch(x) {
case 0:
document.write("Zero");
case 1:
document.write("One");
}
</script>
The output will be ZeroOne because there is no break statement after case 0, so it
falls through to case 1.
283. The type of operators given below:~ is a bitwise NOT operator, = is an assignment operator.
284. The value of the variable d in the code:
JavaScript
var x = 2;
var d = (x % 2) ? 1 : 0;
The value of d will be 0 because x % 2 is 0, which is falsy, so the ternary operator returns 0.
285. IntelliSense is a code-completion aid that includes a number of features: list members,
parameter info, quick info, and complete word.
286. WHAM stands for Web Hypertext Application Model. It is a model for creating web
applications.
287. An IFF is a sound file playable on Pentium computers.
288. JavaScript was developed in 1995 by Brendan Eich.
289. To alert the browser that the code following this is in JavaScript, you would write:
HTML
<script type="text/javascript" src="simples.js"></script>
290. To declare a float variable percent and initialize it with the value 74.75 in JavaScript:
JavaScript
var percent = 74.75;
291. To display “Good Morning “Message” using the console object in JavaScript:
JavaScript console.log("Good Morning \"Message\"");
292. The correct value for the content of array a after execution of the JavaScript code snippet:
JavaScript
var a = ["Pen", "Eraser", "Ruler", "Sharpener"];
a[4] = "Pencil";
The correct option is: d. ["Pen", "Eraser", "Ruler", "Sharpener", "Pencil"]
293. The loop for(c = 1; c < 20; c = c + 5) will run 4 times. The values of c will be 1, 6, 11, 16.
294. To import scripts from external JavaScript files, save the code in a text file with the .js
extension without the script tags. To import scripts from external JavaScript files, save the
code in a text file with the .js extension without the script tags. So, the correct option is:
c. script tags

9
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

295. The output of the following JavaScript code:HTML<html>


<body>
<p id="demo"></p>
<script>
function myFunction(x, y) {
return x + y;
}
document.getElementById("demo").innerHTML = myFunction(15, 8);
</script>
</body>
</html>
The output will be 23 because the function myFunction adds 15 and 8 and returns the
result.
296. Assuming variable A holds 2 and variable B holds 3, the output of (A | B) is 3. The bitwise OR
operator | compares each bit of its operands and returns 1 if either of the bits is 1. In
binary, 2 is 10 and 3 is 11, so 10 | 11 is 11, which is 3 in decimal.
297. The expanded terms are:
i) FPSE: FrontPage Server Extensions
ii) IIS: Internet Information Services
298. Output of is NaN(4)
The output of isNaN(4) is false because 4 is a valid number.
299. Statement to Check if 22/4 is Infinite
To check if 22/4 is infinite, you can use the isFinite function:
JavaScript
console.log(isFinite(22 / 4)); // Output: true
Since 22/4 is a finite number, isFinite will return true.
300. How Many Times Will the Loop Run?
The loop while (true) will run indefinitely (infinite loop) unless there is a break statement
or some other condition to exit the loop.
301. A tool that scans a web page for any technical errors or SEO issues that can negatively impact
search engine ranking is called a website auditor or SEO audit tool.
Examples include tools like Google Search Console, SEMrush, and Ahrefs.
302. VSDC Free Video Editor will work with .wmv, flv, rm, and .mpg files, making it more
versatile than VirtualDub.
303. DVD Shrink is a simple tool for extracting DVD clips from DVDs. The clips are stored only in
VOB format.
304. Bitwise NOT operator operates by reversing all bits in the operand.

10
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

Answer the given questions in 50– 80 words each (3 marks)


1. Difference between <object> and <embed> tags:
▪ The <object> tag is used to embed multimedia files like videos, audio, PDFs, and other web
pages. It is more versatile and can include parameters using the <param> tag1.
▪ The <embed> tag is used to embed external content like multimedia files directly into the
web page. It is simpler and often used for specific content like videos or Flash objects2.
▪ Yes, you can use both <embed> and <object> tags in a single web page to ensure
compatibility across different browsers2.
2. Movie clips:
▪ Movie clips are short segments or excerpts from a movie. They are often used for
promotional purposes, highlights, or to showcase specific scenes3.
3. Timeline:
▪ A timeline is a linear graphical representation of events in chronological order. It is used
to visualize the sequence of events, processes, or historical data4.
4. Two file formats for audio and video compatible with web pages:
▪ Audio: MP3, WAV
▪ Video: MP4, WebM5
5. Why do we use functions in JavaScript?:
▪ Functions in JavaScript are used to encapsulate code for reuse, improve readability, and
manage complexity. They allow you to define a block of code once and call it multiple times
with different arguments6.
6. JavaScript function to return the product of two numbers:
JavaScript
function multiply(a, b) {
return a * b;
}
7. Output of the following statements:
▪ Math.round(4.7); returns 5
▪ Math.round(4.4); returns 4
8. Work Integrated Learning:
▪ Work Integrated Learning (WIL) is an educational approach that integrates academic
learning with practical work experience. It allows students to apply theoretical knowledge
in real-world settings.
9. End User Development (EUD):
▪ End User Development refers to the practice where end users create or modify software
applications without needing deep programming knowledge. It empowers users to tailor
software to their specific needs.
10. Two uses of Timeline view:
▪ Visualizing project schedules and milestones.
▪ Tracking historical events or processes in chronological order.
11. View facilitating the trimming of a video:
▪ The Timeline view facilitates the trimming of a video. When a video clip is trimmed, the
unwanted portions are removed, and only the desired segment is kept.
12. Changing the default file storage location in Windows Movie Maker:
▪ To change the default file storage location in Windows Movie Maker, go to the “Options”
menu, select “Settings,” and then choose the new default save location.
13. Contiguous clips example:
▪ Contiguous clips are video segments placed next to each other on the timeline without any
gaps. For example, if you have a video “Trial” divided into clip1, clip2, and clip3, placing
them sequentially on the timeline without any space between them makes them
contiguous.
14. Difference between .gif and .jpg file format:
▪ GIF: Supports animation and transparency, limited to 256 colors.
▪ JPG: Supports millions of colors, better for photographs, does not support transparency or
animation.
11
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

15. Multimedia:
▪ Multimedia refers to content that uses a combination of different forms such as text, audio,
images, animations, video, and interactive content.
16. Embedding MP3 file using <object> tag:
HTML
<object data="music.wav" type="audio/mpeg">
<param name="autoplay" value="true">
</object>
17. AUTOSTART attribute of <embed> tag:
▪ The AUTOSTART attribute specifies whether the embedded media should start playing
automatically when the page loads. For example, <embed src="music.mp3"
autostart="true">.
18. Difference between Client-side and Server-side JavaScript:
▪ Client-side JavaScript: Runs in the user’s browser, used for creating interactive web
pages.
▪ Server-side JavaScript: Runs on the server, used for backend processing and database
interactions.
19. Output of the following:
▪ A="Hardwork pays"
▪ var d = A.indexOf("pays") returns 9
▪ document.write(A.length) returns 13
20. Full form of PDF and explanation:
▪ PDF: Portable Document Format. It is a file format developed by Adobe that preserves the
formatting of a document across different devices and platforms.
21. Preview Monitor in Windows Movie Maker:
▪ The Preview Monitor allows you to view and edit your video clips before finalizing the
project.
22. Dragging clips or transitions from one project to another:
▪ You can drag clips or transitions from one project to another by selecting and dragging
them to the desired location. Changes made to the clips do not reflect in the source file.
23. Steps to create clips from a single existing video:
▪ Import the video into Windows Movie Maker.
▪ Use the “Split” tool to divide the video into smaller clips.
▪ Arrange and edit the clips as needed.
24. Compression of GIF and JPEG formats:
▪ Yes, both GIF and JPEG formats can be compressed. They are popular for FTP and WWW
because they reduce file size while maintaining acceptable quality.
25. Slideshow as Multimedia:
▪ Yes, a slideshow can be considered multimedia as it combines images, text, and sometimes
audio or video.
26. Two tags to embed a Flash file into a web page:
▪ <object> and <embed> tags.
27. How a MIDI file works:
▪ A MIDI file contains digital instructions for music playback, such as notes, pitch, and
velocity, which are interpreted by electronic instruments or software.
28. Difference between = and == operators:
= is an assignment operator, e.g., a = 5;
▪ == is a comparison operator that checks for equality, e.g., a == 5;
29. Output of the switch statement:
▪ The output will be nothing because the case labels should be case 1: and case 2: instead
of case1: and case2:.
30. Contiguous clips in the video “Trial”:
▪ If “Trial” is divided into clip1, clip2, and clip3, placing them sequentially on the timeline
without gaps makes them contiguous clips.

12
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

31. Usefulness of Timeline view:


▪ Helps in organizing and visualizing the sequence of events or tasks.
▪ Facilitates editing and trimming of video clips.
32. Steps to import files into Windows Movie Maker:
▪ Open Windows Movie Maker.
▪ Click on “Import Media.”
▪ Select the files you want to import and click “Open.”
33. Difference between Property and Method with example:
▪ Property: A value associated with an object, e.g., object.property.
▪ Method: A function associated with an object, e.g., object.method().
34. Fall through in switch statement:
▪ Fall through occurs when there is no break statement in a case, causing the execution to
continue to the next case. For example:
JavaScript
switch(a)
{
case 1:
case 2: document.write("Hello"); break;
}
35. Snippets and their advantage:
▪ Snippets are small pieces of reusable code. They save time and reduce errors by providing
pre-written code blocks.
36. Usefulness of a PSD template for a web designer:
▪ PSD templates provide a layered design file that can be easily edited and customized,
saving time and ensuring consistency.
37. Difference between <object> and <embed> tags:
▪ The <object> tag is more versatile and can include parameters using the <param> tag.
▪ The <embed> tag is simpler and often used for specific content like videos or Flash objects.
38. Objects in JavaScript and difference between properties and methods:
▪ Objects in JavaScript are collections of properties and methods. Properties are values
associated with an object, while methods are functions that operate on the object’s
properties.
39. Two characteristics of typeof operator in JavaScript:
▪ Returns a string indicating the type of the operand.
▪ Can be used to check the type of variables, e.g., typeof 42 returns "number".
40. Difference between % and / operators in JavaScript:
▪ % is the modulus operator, which returns the remainder of a division, e.g., 5 % 2 returns 1.
▪ / is the division operator, which returns the quotient of a division, e.g., 5 / 2 returns 2.5.
41. Difference between Snippet and Add-ins:
▪ Snippets are small pieces of reusable code, while add-ins are additional software
components that add specific features to an application.
42. Two features of JavaScript:
▪ Dynamic typing: Variables can hold values of any type.
▪ First-class functions: Functions can be treated as variables and passed as arguments.
43. Built-in methods:
(i) The built-in method that returns the calling string value converted to uppercase
is toUpperCase(), e.g., "hello".toUpperCase() returns "HELLO".
(ii) The built-in method that returns the string representation of the number’s value is toString(),
e.g., (123).toString() returns "123".
44. Difference between == and ===:
• == checks for equality of value, performing type conversion if necessary,
E.g. 5 == "5" returns true.
• === checks for equality of both value and type, without type conversion,
E.g. 5 === "5" returns false.

13
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

45. Output of the following JavaScript statements:


• document.write(1 + "2" + "2"); outputs 122. document.write("1" + "2" + "2"); outputs 122.
46. Two compatible file formats:
i. Movies: MP4, WebM.
ii. Images: JPEG, PNG.
47. Difference between publishing and exporting a Flash movie:
• Publishing: Involves creating a final version of the Flash movie that is ready for distribution,
including all necessary files and settings.
• Exporting: Refers to saving the Flash movie in a different format, such as an image sequence
or video file, for use in other applications.
48. CSS templates:
CSS templates are pre-designed style sheets that define the look and layout of web pages. They
help in maintaining a consistent design across multiple pages and can be customized to fit specific
needs.
49. Steps to join movie clips in Movie Maker:
i. Import the clips into Windows Movie Maker.
ii. Drag the clips to the timeline in the desired order.
iii. Use the “Join” or “Merge” option to combine the clips into a single video.
50. Difference between frame and key frame:
✓ Frame: A single image in a sequence of images that make up a video or animation.
✓ Key Frame: A frame that defines the starting or ending point of any smooth transition in an
animation. Key frames are used to set important positions or states.
51. Names of Labels A and B in Movie Maker interface:
Without a specific interface image, it’s challenging to name the exact labels. Typically, labels
might include “Timeline” and “Preview Monitor.”
52. Two ways to convert a string to a number in JavaScript:
✓ Using parseInt(), e.g., parseInt("123") returns 123.
✓ Using Number(), e.g., Number("123") returns 123.
53. What is a movie? Write any two ways to share a movie.
▪ A movie is a recording of moving images that tells a story and is watched on a screen or
television.
▪ Two ways to share a movie:
1. Teleparty: A browser extension that allows you to watch movies together with friends
online by syncing playback and adding a group chat2.
2. Prime Video Watch Party: A feature on Amazon Prime Video that lets you watch movies
with up to 100 friends simultaneously2.
54. Combining Clip1 and Clip3 in Windows Movie Maker:
Yes, you can combine Clip1 and Clip3 by placing them sequentially on the timeline. However,
if Clip2 is in between them, you would need to move or delete Clip2 to make them contiguous.
55. Steps to avoid including the title, author in the published movie file:
▪ Open Windows Movie Maker.
▪ Go to the “File” menu and select “Publish Movie.”
▪ In the publishing options, uncheck the boxes for “Include title” and “Include author.”
56. Difference between Client-side JavaScript and Server-side JavaScript:
▪ Client-side JavaScript: Runs in the user’s browser, used for creating interactive web pages.
▪ Server-side JavaScript: Runs on the server, used for backend processing and database
interactions.
57. Output of the following:
✓ A = "Be positive"
✓ var d = A.indexOf("positive") returns 3
✓ document.write(A.length) returns 11
58. Purpose of Add-ins and steps to install a downloaded Add-in:
✓ Purpose: Add-ins extend the functionality of software applications by adding new features.
✓ Steps to install:
1. Download the add-in file.
14
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

2. Open the application and go to the “Add-ins” or “Extensions” menu.


3. Select “Install Add-in” and browse to the downloaded file.
4. Follow the prompts to complete the installation.
59. What is IntelliSense? Steps to view IntelliSense:
▪ IntelliSense: A feature in code editors that provides code suggestions, completions, and
documentation as you type.
▪ Steps to view:
1. Open your code editor (e.g., Visual Studio Code).
2. Start typing your code, and IntelliSense suggestions will appear automatically.
60. Command to declare ‘AR’ and one property of an array:
• Command: var AR = [];
• Property: length - Returns the number of elements in the array, e.g., AR.length.
61. Properties and methods of an object:
✓ Properties: Values associated with an object, e.g., object.property.
✓ Methods: Functions associated with an object, e.g., object.method().
62. Two points about Snippets:
✓ Snippets are reusable pieces of code that save time and reduce errors.
✓ They can be customized and inserted into your code quickly.
63. Structure of a website and one use:
✓ The structure of a website refers to the organization and hierarchy of its pages and content.
✓ Use: Helps in navigation and ensures a logical flow of information.
64. Two main features of WAX:
✓ High-quality audio and video editing capabilities.
✓ Support for various file formats and plugins.
65. Software for 3D movie making and editing movies:
✓ 3D movie making: Blender.
✓ Editing movies: Adobe Premiere Pro.
66. Non-linear, non-destructive video editing tool and DVD clip extraction tool:
✓ Non-linear editing: Final Cut Pro.
✓ DVD clip extraction: HandBrake.
67. Multimedia and example of multimedia file format:
✓ Multimedia refers to content that uses a combination of different forms such as text, audio,
images, animations, video, and interactive content.
✓ Example: MP4.
68. Output of the given code:
HTML
<html>
<body>
<script>
s = ["Have", "a", "nice", "day"];
s.reverse();
for (i = 0; i < s.length; i++)
document.write(s[i]);
</script> </body>
</html>
Output: dayniceniceHave
69. Compare properties and methods of an object in JavaScript:
✓ Properties: Store data values, e.g., object.property.
✓ Methods: Perform actions, e.g., object.method().
70. Two parameters that HTML calculates to download:
✓ File size.
✓ Download time.
71. Operations under Editing in Windows Movie Maker:
▪ Trimming clips.
▪ Adding transitions and effects.
15
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

72. Preview Monitor in Windows Movie Maker:


▪ The Preview Monitor allows you to view and edit your video clips before finalizing the project.
73. Dragging clips or transitions from one project to another:
▪ You can drag clips or transitions by selecting and dragging them to the desired location.
Changes made to the clips do not reflect in the source file.
74. Difference between % and / operator with example:
▪ % is the modulus operator, which returns the remainder of a division, e.g., 5 % 2 returns 1.
▪ / is the division operator, which returns the quotient of a division, e.g., 5 / 2 returns 2.5.
75. Output of the switch statement:
The output will be Hello because the case labels are correct:
JavaScript
switch(a) {
case 1:
case 2:
document.write("Hello");
break; }
76. Creating a visual diagram of a website and steps to view the structure:
Helpful: It helps in planning and organizing the layout and navigation of the website.
Steps:
• Use a website mapping tool or software.
• Create a new project and add pages and links.
• Arrange the pages to reflect the website structure.
77. Two advantages of DWT (Dynamic Web Template) over Standard template:
a. Easier to update and maintain.
b. Consistent layout across multiple pages.
78. Object properties and methods in JavaScript:
• Properties: Attributes of an object, e.g., object.property.
• Methods: Functions that operate on the object’s properties, e.g., object.method().
79. Function to accept response of a confirm box in JavaScript:
JavaScript
function checkResponse() {
var response = confirm("Press a button!");
if (response == true) {
alert("You pressed OK!");
} else {
alert("You pressed Cancel!");
}
}
80. Corrected JavaScript function:
JavaScript
function rval(num1, num2) {
var m = Math.round(num1 + num2);
document.write(m);
document.write(Math.sqrt(m));
}
81. Difference between dynamic and static websites:
• Dynamic websites: Content is generated in real-time, often using databases and server-
side scripting.
• Static websites: Content is fixed and does not change unless manually updated.
82. Explain two non-destructive and non-linear tools for video editing.
Ans : Two Non-destructive and non-linear tools for video editing are :
a. Zwei-Stien : Video Editor: It makes cutting and joining footage easy and includes a wide
range of built-in adjustable effects that can be used separately or in combination.
b. AVI Tricks Video Editor : It makes cutting and joining footage easy and includes a wide
range of built-in adjustable effects that can be used separately or in combination.
16
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

83. Name and explain two views available in Windows Movie Maker while making a movie.
Ans : Two views are :
Timeline View: The timeline view provides a more detailed view of our movie project and allows
us to make finer edits.
Storyboard View: The storyboard is the default view in Windows Movie Maker. We can use the
storyboard to look at the sequence or ordering of the clips in your project and easily rearrange
them.
84. Differentiate between spilt clips and trim clips with respect to Windows Movie Maker.
Ans: Split Clip: The Split button allows us to split a clip into two parts at the point displayed in
the preview monitor.
Trim clips : the trimmed part of the clip is not actually removed from the source file; it's just
hidden so the trimmed part doesn't appear in our project or published movie
85. Explain any two advantages of using multimedia on web pages.
Ans : Advantages of using Multimedia on web pages :-
i) Greater Immersion: Adding multimedia elements to a Web page make it easier to draw
attention of viewers.
ii) Enhanced Page Rankings for SEO.
iii) Better Branding: Multimedia sites are frequently preferred by marketing departments
because of their ability to completely present branding
86. Write code snippet in Java Script to find and display highest value from given four numbers
num1, num2, num3 and num4.
Ans :
x= Math.max(num1,num2, num3, num4);
document.write(“ Highest value is :” + x);
87. Which of the following are valid Javascript variable names? Add, function, average1,
my.name, NaN, 2ndobject, obj_hello, wellness
Ans : Add, average1, obj_hello, wellness
88. Describe the importance of add-ins in a web page and give names of any two websites from
where you can download add-ins.
Ans: Add-ins extends the capability of the main program by adding enhanced custom commands
and specialized features.
Add-ins may be downloaded from any of the following:
http://msdn.microsoft.com/en-us/expression/jj873995.aspx
http://www.webassist.com/go/xweb-add-ins
http://www.expressionextras.com/products/lightbox.htm
http://www.dotnetcurry.com/ShowArticle.aspx?ID=534
89. Explain WAX and the different modes in which it can work:
WAX is a high-performance and flexible video compositing and special effects software. It can
work in two modes:
1. Standalone application: Used independently for video editing and effects.
2. Plugin: Integrated with other video editing software to enhance their capabilities.
90. Two features of AVI Tricks:
▪ Supports various video formats for editing.
▪ Provides tools for cutting, joining, and applying effects to videos.
91. Two features of timeline view in Windows Movie Maker:
• Allows for precise editing of video clips by showing their sequence and duration.
• Facilitates the addition of transitions, effects, and audio tracks.
92. Two image file formats popular for FTP and WWW:
• JPEG: Compressible, widely used for photographs.
• GIF: Compressible, supports animation and transparency.
93. Two tips to remember while writing JavaScript commands:
• Always end statements with a semicolon to avoid unexpected errors.
• Use meaningful variable names to make the code more readable and maintainable.

17
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

94. Output of the given code:


HTML
<html>
<body>
<script>
s = ["blue", "red", "orange", "yellow"];
s.reverse();
for (i = 0; i < s.length; i = i + 2)
document.write(s[i].toUpperCase() + "<br>");
</script>
</body>
</html>
Output:
yellow
orange
95. Explain the following terms:
• Code Optimization: The process of improving the efficiency of code by making it run faster,
use less memory, or consume fewer resources.
• Fix Errors: The process of identifying and correcting mistakes or bugs in the code to ensure
it runs correctly and efficiently.
96. Write the output of the following code : isNaN(4)
It returns false because 4 is a valid number.
97. Statement to Check if 22/4 is Infinite
To check if 22/4 is infinite, you can use the is Finite function:
JavaScript
isFinite(22/4);- This will return true because 22/4 is a finite number.
98. How Many Times Will the Following Loop Run?
while (true) - This loop will run indefinitely (infinite loop) because the condition true is always
met.
99. Names of JavaScript Operators
Here are some common JavaScript operators:
a. Arithmetic Operators: +, -, *, /, %
b. Assignment Operators: =, +=, -=, *=, /=
c. Comparison Operators: ==, ===, !=, !==, >, <, >=, <=
d. Logical Operators: &&, ||, !
100. What are Add-ins?
Add-ins are mini-programs that extend the capabilities of applications like Microsoft Word,
Excel, and PowerPoint. They add new features and enhance your workflow by automating tasks,
improving accuracy, and unlocking new creative possibilities6.
101. Expand the Term FPSE
FPSE stands for FrontPage Server Extensions.
102. Tool for Scanning Web Pages for Technical Errors or SEO Issues
A tool that scans a web page for any technical errors or SEO issues that can negatively
impact search engine ranking is Google Search Console.
103. Non-Destructive and Non-Linear Tools for Video Editing
a) Adobe Premiere Pro: This is a non-linear editing tool that allows you to edit video in any
order without altering the original footage. It provides a flexible timeline where you can
make changes, add effects, and rearrange clips without affecting the source material.
b) Final Cut Pro: Another non-linear editing tool, Final Cut Pro offers a magnetic timeline
that allows for easy rearrangement of clips. It also supports non-destructive editing,
meaning any changes made do not affect the original media files.
104. Views in Windows Movie Maker
a) Timeline View: This view provides a detailed look at your movie project, allowing for
precise edits. You can see the exact timing of each clip and make fine adjustments.

18
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

b) Storyboard View: The default view in Windows Movie Maker, it shows the sequence of
clips in your project. This view is useful for quickly rearranging the order of clips.
105. Split Clips vs. Trim Clips in Windows Movie Maker
a) Split Clips: This feature allows you to divide a single clip into two separate clips at a chosen
point. This is useful for inserting transitions or removing unwanted sections in the middle
of a clip.
b) Trim Clips: Trimming involves cutting off the beginning or end of a clip to shorten it. This
is useful for removing unwanted footage at the start or end of a clip.
106. Advantages of Using Multimedia on Web Pages
✓ Enhanced User Engagement: Multimedia elements like videos, images, and audio can
make web pages more interactive and engaging, keeping users on the site longer.
✓ Improved Information Retention: Multimedia can help convey information more
effectively, making it easier for users to understand and remember the content.
107. JavaScript Code Snippet to Find Highest Value
JavaScript
let num1 = 10, num2 = 20, num3 = 30, num4 = 40;
let highest = Math.max(num1, num2, num3, num4);
console.log("The highest value is: " + highest);
output
The highest value is: 40
108. Valid JavaScript Variable Names
Valid:
average1, obj_hello, wellness
Invalid:
Add (capital letters are not recommended),
function (reserved keyword),
my.name (dot is not allowed),
NaN (reserved keyword),
2ndobject (cannot start with a number)
109. Importance of Add-ins in a Web Page
Add-ins enhance the functionality of web pages by providing additional features such
as analytics, social media integration, and interactive elements. Examples of websites to
download add-ins include:
Chrome Web Store
Mozilla Add-ons
Movie Panes in Windows Movie Maker
Content Pane: Displays the media files you have imported.
Storyboard/Timeline Pane: Shows the sequence of clips and allows for editing.
Preview Pane: Allows you to preview your movie as you edit.
110. Adding Titles in a Movie
Titles can be added at the beginning, before a clip, after a clip, or at the end of the movie.
Examples of file extensions supported by Windows Movie Maker:
Audio: .mp3
Video: .mp4
Image: .jpg
111. Multimedia and Graphics
a) Multimedia: The use of different types of media, such as text, audio, images, animations,
and video, to convey information.
b) Raster Graphics: Made up of pixels, resolution-dependent (e.g., JPEG, PNG).
Vector Graphics: Made up of paths, resolution-independent (e.g., SVG, EPS).
112. JavaScript Concepts
a) Event Handler: A function that runs when a specific event occurs.
JavaScript
document.getElementById("myButton").onclick = function()
{
19
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

alert("Button clicked!");
};
b) Objects: Collections of properties and methods.
JavaScript
let car =
{
make: "Toyota",
model: "Corolla",
year: 2020
};
c) Operator: Symbols used to perform operations on variables and values.
JavaScript
let sum = 10 + 20; // + is an arithmetic operator
113. Anonymous Functions in JavaScript
Anonymous functions are functions without a name, often used as arguments to other
functions.
JavaScript
setTimeout(function()
{
console.log("This is an anonymous function.");
}, 1000);
114. DWT, Code Optimization, and Web Hosting
a) DWT (Dynamic Web Template): A template used in web development to maintain a
consistent layout across multiple pages.
b) Code Optimization: The process of improving code to make it more efficient and faster.
c) Web Hosting: A service that allows individuals and organizations to make their website
accessible via the internet.
115. Terms Explained
a) Snippet: A small region of re-usable source code, machine code, or text.
b) SEO (Search Engine Optimization): The practice of increasing the quantity and quality of
traffic to your website through organic search engine results.
c) CSS (Cascading Style Sheets): A style sheet language used for describing the presentation
of a document written in HTML or XML.
116. Comparison of Trimming and Splitting a Movie Clip
Trimming:
• Definition: Trimming involves removing unwanted sections from the beginning or end of a
clip.
Splitting:
• Definition: Splitting divides a clip into two or more parts at a specific point.
117. Features of Google Reader MP3 Player
1. Simple Interface: Easy-to-use interface for playing MP3 files.
2. Playlist Support: Ability to create and manage playlists.
3. Embedded Player: Option to embed the player in websites or blogs.
118. JavaScript Code Predictions
a. document.write(parseInt("101", 2)); Output: 5 (Binary 101 is 5 in decimal)
b. document.write(parseInt("101", 8)); Output: 65 (Octal 101 is 65 in decimal)
c. document.write(parseInt("101", 10)); Output: 101 (Decimal 101 is 101)
119. JavaScript Code to Find First Occurrence of “the”
JavaScript
let userInput = prompt("Enter a string:");
let index = userInput.indexOf("the");
if (index !== -1) {
document.write("First occurrence of 'the' is at index: " + index);
} else {
document.write("'the' not found in the string.");}
20
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

120. Standard Procedures Before Publishing a Website


✓ Examining Structure of a Website:
o Ensure logical organization and navigation.
o Check for broken links and proper hierarchy.
✓ Estimating Size of a Website:
o Calculate total file sizes including images, scripts, and other assets.
o Optimize file sizes for faster loading times.
✓ Code Optimization:
o Minimize and compress CSS, JavaScript, and HTML files.
o Remove unnecessary code and comments.
121. Components of a Web Page Used for Search Engine Indexing
a. Title Tags: The title of the web page, which appears in search results.
b. Meta Descriptions: Brief summaries of the page content.
c. Header Tags (H1, H2, etc.): Used to define headings and subheadings, indicating the
structure of the conten

Answer the given questions in 50– 80 words each (3 marks)


1. Splitting vs. Trimming a Movie Clip in Movie Maker:
a. Splitting: This divides a clip into two parts at a specific point. The original clip is cut into two
separate clips, which can be edited independently.
b. Trimming: This removes unwanted parts from the beginning or end of a clip. The trimmed
parts are hidden but not deleted from the source file.
2. Storyboard and Timeline View in Windows Movie Maker:
a. Storyboard View: This is used for arranging and organizing clips in a sequence. It provides a
simplified view of the project, showing thumbnails of the clips.
b. Timeline View: This is used for detailed editing, allowing you to manage the timing of clips,
audio, transitions, and effects. It shows multiple tracks for video, audio, and other elements.
3. Steps to Split a Clip:
a. Import the video into Windows Movie Maker.
b. Drag the video to the timeline.
c. Play the video and pause at the point where you want to split.
d. Click on the “Split” button in the editing tools.
4. Steps to Change the Title Duration
To change the title duration in a video editing software like Windows Movie Maker:
1. Open your project in Windows Movie Maker.
2. Select the title clip on the timeline.
3. Click on the ‘Edit’ tab in the toolbar.
4. Adjust the duration by changing the time in the ‘Duration’ box.
5. Preview the changes and save your project.
5. Three Advantages of Using Multimedia on Web Pages
1. Enhanced User Engagement: Multimedia elements like videos, images, and audio can make
web pages more interactive and engaging, keeping users on the site longer.
2. Improved Information Retention: Visual and auditory elements can help users better
understand and remember the information presented.
3. Increased Accessibility: Multimedia can make content more accessible to people with
different learning styles and abilities, such as using audio for visually impaired users.
6. Two Types of Image File Formats and Their Differences
1. JPEG (Joint Photographic Experts Group):
• Lossy compression: Reduces file size by discarding some image data, which can result
in a loss of quality.
• Best for photographs: Ideal for images with many colors and gradients.
2. PNG (Portable Network Graphics):
• Lossless compression: Preserves all image data, maintaining high quality.
• Supports transparency: Useful for images with transparent backgrounds.
21
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

7. Type of Operator and Output


Assuming variable A holds 10 and B holds 11:
a. (B–): This is a post-decrement operator. It decreases the value of B by 1 after the
expression is evaluated. So, the output is 11, but B becomes 10.
b. (A != B): This is a not equal to operator. It checks if A is not equal to B. Since 10 is
not equal to 11, the output is true.
8. Define an Event and Two Commonly Used Events
An event is an action or occurrence recognized by software, often originating from user
interactions or other sources.
1. onclick: Triggered when an element is clicked.
2. onload: Triggered when a web page or an image has finished loading.
9. Importance of Website Backup and Steps to Backup Static Pages
Importance: Backing up websites ensures that you can restore your site quickly in case of
data loss, hacking, or other issues. Steps to Backup Static Pages:
1. Access your web server via FTP or a file manager.
2. Download all files from the root directory to your local machine.
3. Save a copy of your website’s database if applicable.
4. Store the backup in a secure location.
10. What are Add-ins and Steps to Install a Downloaded Add-in
Add-ins are software extensions that add extra features to a program.
Steps to Install:
1. Download the add-in from a trusted source.
2. Open the host application (e.g., Microsoft Word).
3. Go to the ‘Insert’ tab and select ‘Add-ins’.
4. Click ‘Manage My Add-ins’ and then ‘Upload My Add-in’.
5. Browse and select the downloaded add-in file.
6. Install and activate the add-in.
11. Define Objects, Properties, and Methods
• Objects: Instances of classes that encapsulate data and functions.
• Properties: Attributes or data stored in an object.
• Methods: Functions or procedures associated with an object.
12. Steps to Import Audio Files in Flash
1. Open Adobe Flash and your project.
2. Go to ‘File’ > ‘Import’ > ‘Import to Library’.
3. Select the audio file and click ‘Open’.
4. Drag the audio file from the library to the timeline.
13. Publishing vs. Exporting a Flash Movie
• Publishing: Creates files needed to display the movie on the web, including HTML and SWF
files.
• Exporting: Converts the movie into different formats like AVI or MOV for use outside the web.
14. Usage of JavaScript Functions
a. pow(x, y): Returns ( x ) raised to the power of ( y ).
b. random(): Returns a random number between 0 and 1.
c. sin(x): Returns the sine of ( x ) (in radians).
15. Difference Between FLA and SWF Format
• FLA: Editable project file used in Adobe Flash.
• SWF: Compressed, non-editable file used for playback on the web.
16. Data Independence and Its Types
Data Independence: The capacity to change the schema at one level without altering the schema
at the next higher level.
• Logical Data Independence: Changing the logical schema without changing the external
schema.
• Physical Data Independence: Changing the physical schema without changing the logical
schema.

22
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

17. Phases of Project Management


1. Initiation: Define the project and its goals.
2. Planning: Develop a roadmap for the project.
3. Execution: Implement the project plan.
4. Monitoring and Controlling: Track progress and make adjustments.
5. Closure: Finalize all activities and close the project.
18. Steps to Split a Clip
1. Open your video editing software.
2. Select the clip you want to split.
3. Move the playhead to the point where you want to split.
4. Click the ‘Split’ button or use the appropriate keyboard shortcut.
19. Three Disadvantages of Using Multimedia on Web Pages
1. Increased Load Times: Multimedia elements can slow down page loading.
2. Higher Bandwidth Usage: Requires more data, which can be costly for users with limited
bandwidth.
3. Accessibility Issues: Not all users can access multimedia content, especially those with
disabilities.
20. Lossy vs. Lossless Image Formats
• Lossy: Compresses data by losing some information. Example: JPEG.
• Lossless: Compresses data without losing any information. Example: PNG.
21. Operator and Output
Assuming variable A holds 20 and B holds 5:
(i) (A && B): Logical AND operator. Output is true (since both A and B are non-zero).
(ii) (A * B): Multiplication operator. Output is 100.
22. Define Data Type and Examples
Data Type: Specifies the type of data that can be stored in a variable. (i) Name of a person:
String. (ii) True/false: Boolean.
23. Web Package and Its Use
Web Package: A collection of files and resources used to create a web application. Use:
Simplifies the deployment and management of web applications.
24. Hyperlink and Recalculating Hyperlinks
Hyperlink: A link from one web page to another. Recalculating Hyperlinks: Ensures all links
are updated and correct after changes to the website structure.
25. Define Function and Example
Function: A block of code designed to perform a specific task. Example:
JavaScript
function showAlert() {
alert("Hard work is the key to success");
}
26. Steps to Trim a Clip in Timeline View
1. Open your video editing software.
2. Select the clip in the timeline.
3. Drag the edges of the clip to trim it to the desired length.
27. Steps to Edit the Existing Title in Windows Movie Maker
1. Open your project in Windows Movie Maker.
2. Select the title clip in the timeline.
3. Click on the ‘Edit’ tab.
4. Make the necessary changes to the title text and duration.
5. Save your project.
28. Two Types of Image File Formats and Their Differences
1. JPEG: Lossy compression, best for photographs.
2. PNG: Lossless compression, supports transparency.
29. Code to Link External JavaScript File
HTML
<!DOCTYPE html>
23
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

<html>
<head>
<title>My Web Page</title>
<script src="code.js"></script>
</head>
<body>
<!-- Content of the webpage -->
</body>
</html>
Placement: The <script> tag should be placed within the <head> section.
30. Final Value of A and B
A = 43
a) A++: A becomes 44.
b) B = A + 1: B becomes 45.
31. Parameters for Page Transition
• Transition type: Specifies the type of transition effect.
• Duration: Specifies how long the transition lasts.
32. Recalculate Hyperlink
Recalculate Hyperlink: Updates all hyperlinks in a document to ensure they point to the
correct locations after changes.
33. Two Views in Windows Movie Maker
1. Storyboard View: Displays the sequence of clips as thumbnails.
2. Timeline View: Displays clips along a timeline, showing their duration.
34. How does a search engine work? Name any two components of a web page that the search
engines use to create an index.
Search engines work by performing three main tasks: crawling, indexing, and ranking.
Crawlers (also known as spiders or bots) navigate the web to discover new pages. These pages
are then processed and added to an index, which is a massive database of all the content the search
engine has found. When a user performs a search, the search engine scours its index to find the
most relevant results and ranks them accordingly.
Two components of a web page that search engines use to create an index are:
1. Title tags: These provide a concise summary of the page’s content.
2. Meta descriptions: These offer a brief description of the page’s content.
35. Explain parseInt() and isNaN(), giving one example of each.
• parseInt(): This function parses a string and returns an integer. It can take a second argument to
specify the radix (base) of the numeral system.
JavaScript
console.log(parseInt("10")); // Output: 10
console.log(parseInt("10", 2)); // Output: 2 (binary 10 is decimal 2)
• isNaN(): This function checks whether a value is NaN (Not-a-Number). It first converts the value
to a number if necessary.
JavaScript
console.log(isNaN("hello")); // Output: true
console.log(isNaN(123)); // Output: false
36. How can we use join() to create a string from an array using JavaScript?
The join() method in JavaScript is used to join all elements of an array into a string, separated
by a specified separator.
JavaScript
let fruits = ["Apple", "Banana", "Cherry"];
let result = fruits.join(", ");
console.log(result); // Output: "Apple, Banana, Cherry"
37. Write the output of the following JavaScript code (Justify your answer):
(i) JavaScript
var x = 10;
function function1() {
24
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

var x = 20;
}
function1();
alert(x);
Output: 10 Justification: The variable x inside function1 is local to the function and does not
affect the global variable x.
(ii) JavaScript
var x = 10;
function function1() {
x = 20;
}
function1();
alert(x);
Output: 20 Justification: The function function1 modifies the global variable x.
38. Explain logical operators in JavaScript.
Logical operators are used to combine multiple conditions. The main logical operators are:
• AND (&&): Returns true if both operands are true.
• OR (||): Returns true if at least one operand is true.
• NOT (!): Returns true if the operand is false.
39. Write the steps to embed a movie in a web page.
To embed a movie in a web page, you can use the <video> tag:
1. Use the <video> tag with the controls attribute to add playback controls.
2. Use the <source> tag inside the <video> tag to specify the video file and its format.
HTML
<video controls>
<source src="movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
40. Write the name of one sound editing, one image editing, and one movie editing software.
• Sound editing: Audacity
• Image editing: Adobe Photoshop
• Movie editing: Adobe Premiere Pro
41. What are snippets? How are they created and where are they stored?
Snippets are small pieces of reusable code or text. They are created to save time and ensure
consistency. Snippets can be stored in code editors, content management systems, or snippet
management tools.
42. What are dynamic web templates? Why are they useful?
Dynamic web templates are templates that allow for the creation of web pages with dynamic
content. They are useful because they enable the separation of content from design, making it
easier to update and manage websites.
43. What are forms? Name two elements of a form.
Forms are used to collect user input on web pages. Two elements of a form are:
1. Input fields: For text, email, password, etc.
2. Submit button: To submit the form data.
44. Name the two views where the project in Windows Movie Maker project is created and
edited. Out of the two, which is the default view? Also, write one point of difference between
them.
• Storyboard view: Default view, shows the sequence of clips.
• Timeline view: Shows the timing of clips and allows for more detailed editing.
45. What happens when we trim a clip? Write steps to undo a trimmed clip.
Trimming a clip removes parts of the clip from the beginning or end. To undo a trimmed clip:
1. Go to the Edit menu.
2. Select Undo Trim.

25
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

46. Write any three advantages of using Multimedia on Web Pages.


1. Enhanced user engagement: Multimedia elements like videos and images can capture users’
attention.
2. Improved information retention: Visual and audio elements help users remember
information better.
3. Better user experience: Multimedia can make web pages more interactive and enjoyable.
47. Assuming variable A holds 25 and B holds 2, identify the type of operator and write the
output of the following:
a. (B--) Output: 2 (Post-decrement operator, returns the value before decrementing)
b. (A != B) Output: true (Inequality operator, checks if A is not equal to B)
48. Define an Event. Write any two commonly used Events.
An event is an action or occurrence detected by the browser, such as a user interaction. Two
commonly used events are:
1. click: Triggered when an element is clicked.
2. mouseover: Triggered when the mouse pointer is moved over an element.
49. Why is it important to backup websites? Write any one reason. Also, write steps to take a
backup of the website containing static pages.
Reason: To prevent data loss in case of server failure or hacking. Steps:
1. Download all website files via FTP.
2. Export the database if applicable.
3. Store the backup in a secure location.
50. Samantha has created a website that has web pages that give information on first aid. With
respect to the above description, classify the website as static or dynamic. Also,
differentiate between Static and Dynamic websites.
Classification: Static Difference:
• Static websites: Content does not change unless manually updated.
• Dynamic websites: Content can change based on user interaction or other factors.
51. Write a function in JavaScript that accepts two integer variables and returns their sum.
JavaScript
function sum(a, b) {
return a + b;
}
console.log(sum(5, 10)); // Output: 15
52. Explain the term inner function in JavaScript with an example.
An inner function is a function defined inside another function. It has access to the outer
function’s variables.
JavaScript
function outerFunction() {
var outerVariable = "I'm outside!";
function innerFunction() {
console.log(outerVariable);
}
innerFunction();
}
outerFunction(); // Output: I'm outside!
53. Explain the use of reverse method in JavaScript. Write a function ‘Revrs’ in JavaScript to
explain reverse the order of elements in a given array.
The reverse() method reverses the order of elements in an array.
JavaScript
function Revrs(arr) {
return arr.reverse();
}
console.log(Revrs([1, 2, 3])); // Output: [3, 2, 1]

26
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

54. Rakshit has created a website and his friend has suggested to him to go for a free hosting
server as Rahul is still learning to create a website.
a) Requirement to host a website with one’s own server: A server, domain name, and
technical knowledge to manage the server. b) Method to upload website: FTP (File Transfer
Protocol)
55. Give two examples of each type of video, audio, and picture file formats supported by
Windows Movie Maker.
• Video: .wmv, .mp4
• Audio: .mp3, .wav
• Picture: .jpg, .png
56. Is it possible to undo trim changes in a clip in Windows Movie Maker? Explain the term
contiguous clips. Name the two file formats in which a movie file is stored in Windows
Movie Maker.
• Undo trim changes: Yes, by using the Undo command.
• Contiguous clips: Clips that are placed next to each other without any gaps.
• File formats: .wmv, .mp4
57. Explain any three attributes of object tag.
1. data: Specifies the URL of the resource to be used by the object.
2. type: Specifies the MIME type of the resource.
3. width: Specifies the width of the object.
58. Three Applications of JavaScript
1. Web Development: JavaScript is essential for creating interactive and dynamic web pages. It
allows developers to implement complex features like animations, form validations, and
interactive maps1.
2. Mobile App Development: JavaScript, along with frameworks like React Native, is used to
build cross-platform mobile applications that run on both iOS and Android2.
3. Game Development: JavaScript is also used in developing browser-based games. Libraries
like Phaser make it easier to create 2D games3.
59. JavaScript Code to Convert Binary to Decimal
JavaScript
function binaryToDecimal(binary)
{
return parseInt(binary, 2);
}
let binaryNumber = prompt("Enter a binary number:");
let decimalNumber = binaryToDecimal(binaryNumber);
alert("The decimal equivalent is: " + decimalNumber);
60. Use of CSS and Free Design Websites
CSS (Cascading Style Sheets) is used to style and layout web pages.
It allows you to control the color, font, spacing, and positioning of elements on a webpage.
Two websites that offer free designs:
1. Free CSS: Free CSS
2. TemplateMo: TemplateMo
61. JavaScript Code to Sort an Array
JavaScript
let numbers = [];
for (let i = 0; i < 5; i++) {
numbers.push(parseInt(prompt("Enter a number:")));
}
numbers.sort((a, b) => a - b);
alert("Sorted array: " + numbers);
62. Changing Title Duration and Adding Titles in Movies
The title duration in a movie can be changed using video editing software like Adobe
Premiere Pro or Final Cut Pro. Besides the beginning or end, you can add a title in the middle
of a movie to introduce a new segment or chapter.
27
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

63. Five Advantages of Using Multimedia on Web Pages


1. Enhanced User Experience: Multimedia elements like videos and animations make the
website more engaging.
2. Better Communication: Visual and audio elements can convey information more effectively
than text alone.
3. Increased Retention: Users are more likely to remember information presented through
multimedia.
4. SEO Benefits: Multimedia content can improve search engine rankings.
5. Accessibility: Multimedia can make content more accessible to people with different learning
styles.
64. Operators and Outputs
Assuming A holds 20 and B holds 5:
1. (A && B) - Logical AND operator. Since both A and B are non-zero, the result is true.
2. (A * B) - Multiplication operator. The result is 100.
65. Data Types
Data type: A classification that specifies which type of value a variable can hold.
• Name of a person: String
• True/False: Boolean
66. What is a Web Package? Explain the use of the Web Packages feature.
A Web Package is a collection of files and resources bundled together to be used in
web development. This can include HTML, CSS, JavaScript, images, and other assets. The
purpose of web packages is to streamline the development process by organizing and
managing dependencies efficiently.
Use of Web Packages Feature:
• Dependency Management: Web packages help manage and resolve dependencies between
different modules and libraries.
• Code Optimization: Tools like Webpack bundle and minify code, reducing file size and
improving load times.
• Modularity: Encourages writing modular code, making it easier to maintain and update.
67. How is SEO useful? Write any two components of the web page that the search engines
index.
SEO (Search Engine Optimization) is crucial for improving the visibility of a website
on search engine results pages (SERPs). It helps attract organic traffic, increase brand
awareness, and improve user engagement.
Two Components of a Web Page that Search Engines Index:
1. Title Tags: The title of a web page, which appears in search engine results and browser tabs2.
2. Meta Descriptions: Brief summaries of web page content that appear under the title in search
results2.
68. Using the Embed Tag for Audio
To include an audio file repeatedly on a web page, you can use the <embed> tag. Here are the
attributes you can use:
• src: Specifies the path to the audio file.
• width and height: Set the size of the audio player.
• loop: Makes the audio file play repeatedly.
Example:
HTML
<embed src="audiofile.mp3" width="300" height="50" loop="true">
69. JavaScript Program for User Input and Display
JavaScript
// a) Accept first name and last name from the user
let firstName = prompt("Enter your first name:");
let lastName = prompt("Enter your last name:");
// b) Display number of characters in the first name
alert("Number of characters in your first name: " + firstName.length);

28
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

// c) Display current date and formatted name


let currentDate = new Date();
let formattedName = firstName.charAt(0) + ". " + lastName;
alert("Current date: " + currentDate + "\nFormatted name: " + formattedName);
70. JavaScript Program to Display a Random Weekday
JavaScript
let dow = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
let randomDay = dow[Math.floor(Math.random() * dow.length)];
alert("Random weekday: " + randomDay);
AI-generated code. Review and use carefully. More info on FAQ.
71. JavaScript Code to Find First Occurrence of “good”
JavaScript
let userInput = prompt("Enter a string:");
let firstOccurrence = userInput.indexOf("good");
if (firstOccurrence !== -1) {
alert("The first occurrence of 'good' is at position: " + firstOccurrence);
} else {
alert("'good' not found in the entered string.");
}
72. Predict Output of JavaScript Code
HTML
<html>
<body>
<script>
n = 20;
m = n >> 2; // Right shift by 2 bits (20 / 4 = 5)
x = n << 2; // Left shift by 2 bits (20 * 4 = 80)
document.write("Value after right shift is: " + m);
document.write("<br>Value after left shift is: " + x);
</script>
</body>
</html>
Output:
Value after right shift is: 5
Value after left shift is: 80

JavaScript Code to Find Tallest and Smallest Height


JavaScript
let heights = [];
for (let i = 0; i < 5; i++) {
heights.push(parseFloat(prompt("Enter height of student " + (i + 1) + ":")));
}
let tallest = Math.max(...heights);
let smallest = Math.min(...heights);
alert("Tallest height: " + tallest + "\nSmallest height: " + smallest);
73. WAX Special Effects Modes
WAX can create special effects and work in two modes:
1. Standalone Mode: In this mode, WAX functions as a standalone application for video editing
and special effects creation.
2. Plugin Mode: WAX can also work as a plugin for other video editing software like Sony Vegas,
allowing users to add special effects directly within their primary editing environment.
74. Two Advantages of Using Multimedia Files on Web Pages
1. Enhanced Engagement: Multimedia elements like videos, audio, and animations make web
pages more engaging and interactive, keeping users on the site longer.

29
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

2. Improved Communication: Multimedia can convey complex information more effectively


than text alone, making it easier for users to understand and retain information.
75. Correcting JavaScript Code
Sunil’s code has some syntax errors. Here is the corrected version:
JavaScript
function countsubs() {
var subject = ["Eng", "Math", "Science", "Hindi"];
document.write(subject.length);
}

Corrections:
• Changed Var to var.
• Changed Subject to subject to maintain consistent variable naming.
• Changed Document.write to document.write.
76. Add-ins and Snippets
• Add-ins: These are additional software components that add specific features or
functionalities to an existing application. For example, browser add-ins can enhance the
capabilities of web browsers.
• Snippets: These are small, reusable pieces of code that can be inserted into a larger codebase.
Snippets help speed up development by providing pre-written code for common tasks.
77. Kompozer and Dreamweaver as Web Authoring Tools
• Kompozer: An open-source WYSIWYG (What You See Is What You Get) web authoring tool
that allows users to create and edit web pages without needing to write HTML code manually.
• Dreamweaver: A professional web development tool by Adobe that offers a comprehensive
suite of features for designing, coding, and managing websites. It supports both visual design
and code editing.
78. Advantages of Splitting Video Clips in Windows Movie Maker
• Focused Editing: Splitting video clips allows for more precise editing, enabling users to apply
effects, transitions, or edits to specific sections of the video.
• Improved Organization: Splitting clips helps in organizing the video project, making it easier
to manage and edit different parts of the video.
• Combining Split Files: Yes, split files can be combined together in Windows Movie Maker by
placing them sequentially on the timeline and applying transitions if needed.
79. Three Applications of JavaScript
1. Web Development: Creating interactive and dynamic web pages.
2. Mobile App Development: Building cross-platform mobile applications using frameworks
like React Native.
3. Game Development: Developing browser-based games using libraries like Phaser.
80. Explanation of Terms
• Add-ins: Additional software components that extend the functionality of an existing
application.
• Snippets: Small, reusable pieces of code that can be inserted into a larger codebase.
• IntelliSense: A code-completion feature in many IDEs (Integrated Development
Environments) that provides suggestions and auto-completion for code as you type.
81. Advantage of Splitting Video Clips in Windows Movie Maker
Advantages:
• Easier Editing: Splitting video clips allows you to edit specific sections of your video more
precisely. You can remove unwanted parts, add transitions, or apply effects to individual
segments.
• Improved Organization: It helps in organizing your project by breaking it down into smaller,
more manageable parts.
• Enhanced Control: You can adjust the timing and sequence of clips more effectively.
• Combining Split Files: Yes, the split files can be combined together in Windows Movie
Maker. You can simply drag and drop the split clips back-to-back on the timeline to create a
seamless video.
30
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

82. Applications of JavaScript


1. Web Development: JavaScript is widely used to create interactive web pages. It allows for
dynamic content updates, form validations, and animations.
2. Server-Side Development: With environments like Node.js, JavaScript can be used for
server-side scripting to build scalable network applications.
3. Game Development: JavaScript is used to create browser-based games, leveraging libraries
like Phaser.js for game development.
83. Three Panes of Windows Movie Maker
1. Storyboard/Timeline Pane: This pane is used to arrange and edit the sequence of video
clips, photos, and audio.
2. Contents Pane: Displays the imported media files, such as videos, photos, and audio clips, that
you can use in your project.
3. Preview Pane: Allows you to preview your project as you edit, giving you a real-time view of
your movie.
84. JavaScript Function to Display the Greatest Number
JavaScript
function findGreatest(num1, num2, num3) {
let greatest = num1;
if (num2 > greatest) {
greatest = num2;
}
if (num3 > greatest) {
greatest = num3;
}
console.log("The greatest number is: " + greatest);
}
85. Embedding Media File in Web Page
HTML
<EMBED SRC="grows.mp3" HIDDEN="TRUE" AUTOSTART="TRUE" LOOP="TRUE"
Height="145" Width="160"></EMBED>
86. Features of JavaScript
1. Interactivity: JavaScript allows for creating interactive web pages with dynamic content
updates.
2. Versatility: It can be used on both client-side and server-side, making it a versatile language
for full-stack development.
87. Difference Between <object> and <embed> Tag
• <object> Tag: Used to embed multimedia files and can handle more types of media. It is more
versatile and supports fallback content.
• <embed> Tag: Specifically used to embed multimedia files like audio and video. It is simpler
but less flexible than <object>.
Using Both Tags: Yes, you can use both <embed> and <object> tags in a single web page to ensure
compatibility across different browsers.
88. Object Properties and Methods in JavaScript
• Object Properties: These are variables that belong to an object. They define the
characteristics of the object.
• Object Methods: These are functions that belong to an object. They define the behavior of the
object.
89. Function to Handle Confirm Box Response
JavaScript
function handleConfirm() {
let userResponse = confirm("Do you want to proceed?");
if (userResponse) {
console.log("User pressed OK");
} else {
console.log("User pressed Cancel"); }}
31
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

90. Corrected JavaScript Function


JavaScript
function rval(num1, num2) {
var m = Math.round(num1 + num2);
document.write(m);
document.write(Math.sqrt(m));
}
91. Difference Between Dynamic and Static Websites
• Dynamic Websites: Content is generated in real-time based on user interactions or other
factors. Examples include social media sites and e-commerce platforms.
• Static Websites: Content is fixed and does not change unless manually updated. Examples
include personal blogs and portfolio sites.
92. Random Function in JavaScript
The Math.random() function returns a floating-point, pseudo-random number between 0
(inclusive) and 1 (exclusive).
JavaScript
let randomNum = Math.random();
console.log(randomNum);
93. Snippets
Snippets: Small pieces of reusable code that can be inserted into a larger codebase. They help
in speeding up development and ensuring consistency.
Uses:
• Code Reusability: Snippets can be reused across different projects.
• Efficiency: They save time by reducing the need to write repetitive code.
• Consistency: Ensure consistent coding practices across a team.
94. Datatype and String to Integer Conversion
Datatype: Defines the type of data a variable can hold, such as numbers, strings, or objects.
Conversion Function: parseInt()
JavaScript
let str = "123";
let num = parseInt(str);
console.log(num); // Outputs: 123
95. Three Types of Panes in Windows Movie Maker
1. Storyboard/Timeline Pane: For arranging and editing clips.
2. Contents Pane: Displays imported media files.
3. Preview Pane: For previewing the project.
96. JavaScript Code Snippet for Salary and Bonus
JavaScript
let salary = 10000.00;
let bonus = salary * 0.05;
console.log("Salary: " + salary);
console.log("Bonus: " + bonus);
97. JavaScript Functions
• substring(start, end): Extracts a part of a string between the start and end indices.
• concat(): Joins two or more strings.
• shift(): Removes the first element from an array and returns it.
98. Terms Explanation
• Addins: Additional features or plugins that extend the functionality of software.
• DWT Feature: One feature is the ability to create templates for consistent design across
multiple pages.
• Web Package: A collection of files and resources used to create a web application.
99. Roshan’s Movie Files
1. File Types:
✓ hello.mpe: Video file
✓ morning.aif: Audio file
32
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

✓ smile.gif: Image file


✓ sunrise.tiff: Image file
2. Preview Option: Use the Preview Pane to see the movie before publishing.
3. Default Extension: .wlmp
100. Multimedia Elements in Web Pages
1. Advantage: Enhances user engagement. Disadvantage: Can increase page load time.
2. Browser: Google Chrome supports multimedia elements.
3. Tag for Sound: <bgsound> (works only with Internet Explorer)
101. Trimming Movie Clips and Preview Monitor
Trimming Movie Clips: Removing unwanted parts from the beginning or end of a clip to
refine the video.
Preview Monitor: Allows you to view and review your project as you edit, ensuring the final
output meets your expectations.
102. Consider the following code and answer the questions given below:
<object>
<param name="autostart" value="true">
<param name="src" value="eureka.wav">
<param name="autoplay" value="true">
<param name="controller" value="true">
<embed src="eureka.wav" controller="false" autoplay="true" autostart="True"
type="audio/wav" />
</object>
i) Name the file embedded in above code. The file embedded in the code is eureka.wav.
ii) How many times will the file run/play? The file will play once.
iii) Explain use of autostart attribute.
The autostart attribute is used to specify that the audio should start playing
automatically as soon as it is loaded. In the <param> tag, setting autostart to true ensures that
the audio begins playback immediately upon loading.
iv) Does browser display the controller to viewers?
In the <param> tag, the controller attribute is set to true, which would typically indicate
that playback controls should be displayed. However, in the <embed> tag, the controller
attribute is set to false, which means the controls will not be displayed. The behavior might
vary depending on the browser, but generally, the <embed> tag’s settings will take precedence,
so the controller will not be displayed
103. Event Handler in JavaScript
a. Event Handler Explanation: An event handler is a function that is executed when a specific
event occurs. Examples include clicking a button, hovering over an element, or submitting a
form.
Examples:
1. Click Event:
JavaScript
document.getElementById("myButton").onclick = function()
{
alert("Button clicked!");
};
2. Mouseover Event:
JavaScript
document.getElementById("myElement").onmouseover = function()
{
this.style.color = "red";
};
b. Random Number and Even/Odd Check:
javascript function checkRandomNumber()
{
let randomNum = Math.floor(Math.random() * 100) + 1;
33
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

if (randomNum % 2 === 0)
{
console.log(randomNum + " is even.");
}
Else
{
console.log(randomNum + " is odd.");
}
}
104. JavaScript Functions
a. Display Current Date:
javascript window.onload = function()
{
document.getElementById("dateDisplay").innerHTML = new Date().toDateString();
};
b. Remove Last Element and Display in Uppercase:
javascript function removeLastElement(ar1)
{
let removedElement = ar1.pop();
console.log(removedElement.toUpperCase());
}
c. Index of ‘the’ and Length of String:
javascript function findTextAndLength(S1)
{
let index = S1.indexOf('the');
let length = S1.length; console.log("Index of 'the': " + index);
console.log("Length of string: " + length);
}
105. Average of Integer Arguments
JavaScript
function average(...numbers) {
let sum = numbers.reduce((acc, num) => acc + num, 0);
return sum / numbers.length;
}
106. Array Manipulations
a. Add “Guava” to the Array: javascript fruits.push("Guava");
b. Remove First Element: javascript fruits.shift();
c. Display Number of Elements: javascript console.log(fruits.length);
d. Add Another Array: javascript fruits = fruits.concat(veg);
107. String Manipulations
JavaScript
function stringsinjava(string1, string2)
{
string1 = string1.toUpperCase();
string2 = string2.toUpperCase();
if (string2.includes(string1))
{
console.log("String found: " + string1);
}
string1 = string1.replace(/A/g, '*');
console.log("Modified string1: " + string1);
console.log("First character of string2: " + string2.charAt(0));
}

34
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

108. Trimming Movie Clips in Windows Movie Maker


Trimming Movie Clips: Trimming involves cutting out unwanted parts from the beginning or
end of a video clip. This helps in refining the video by removing unnecessary sections and
focusing on the important parts.
109. Use of Preview Monitor in Windows Movie Maker
Preview Monitor: The preview monitor allows you to view and review your project as you
edit. It provides a real-time view of your movie, helping you ensure that the final output meets
your expectations and allowing you to make adjustments as needed.
110. Name three movie panes of the Window Movie Maker and explain their functions?
Ans : The movie panes of Windows Movie Maker are :
i)The Tasks pane lists the common tasks that may be needed to perform while making a movie,
including importing files, editing, and publishing your movie.
ii) The Collections pane displays our collection of folders, which contain clips. The collection
folders appear in the Collections pane on the left, and the clips in the selected collection folder
are displayed in the Contents pane on the right.
iii) The Contents pane shows clips, effects, or transitions that are working with while creating
our movie, depending on the view being worked with.
111. Name the places where titles can be added in a movie. Give an example of audio, video
and image file extension supported by Windows Movie Maker.
Ans : Title text can be added to various places in Movie Maker :
a. at the beginning or at the end,
b. before or after a clip,
c. Overlaying a clip.
Video files: .asf, .avi, ..mpg, .mpv2, .wm, and .wmv (any one)
Audio files: .aif, .aifc, .mpa, .snd, .wav, and .wma (any one
Picture files: .bmp, .dib, .emf, .tiff, and .wmf (any one)
112. Explain the term Multimedia. Differentiate between raster and vector graphics.
Ans: Multimedia: Multimedia is the media that uses multiple forms of information content
and information processing (e.g. text, audio, graphics, animation, video, interactivity) to
inform or entertain the user.
A raster image is one composed of a field of pixels, each characterized by a color, and is usually
created in paint programs, by scanning a picture or by grabbing an image.
A vector format is created almost always by a drawing/CAD program and consists not of
pixels, but objects such as curves, shades, and characters.
113. Explain the following with respect to Java script using suitable example. Event handler,
Objects, Operator
Ans :
Event Handler - The "event handler" is a command that is used to specify actions in response
to an event. .
Eg: onLoad, onMouseover etc.
Objects: JavaScript objects are simply collections of name-value pairs. The "name" part is a
JavaScript string, while the value can be any JavaScript value including more objects.
Eg: string object, math object etc
Or
JavaScript supports programming with objects. Objects are a way of organizing the
variables. The different screen elements such as Web pages, forms, text boxes, images, and
buttons are treated as objects.
Operator: Operators are symbols which perform some operation on values. JavaScript
operators can be used to perform various operations such as:
a. Arithmetic Operators
b. Comparison Operators
c. Logical Operators
d. Relational Operators
e. Assignment Operators
f. Conditional Operators
35
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

114. Explain anonymous functions in JavaScript with an example.


Ans: Anonymous functions are the functions without any name.
For example :
var avg = function()
{
var sum = 0;
for (var i = 0, j = arguments.length; i < j; i++)
{
sum += arguments[i];
}
return sum / arguments.length;
}
115. Explain DWT, Code optimization and Web Hosting.
Ans: DWT: DWT stands for dynamic web template. Templates help you organize the entire
website to have a consistent look and feel. This is very helpful when you work with large number
of web pages.
Code Optimization: Before you publish, you need to cleanup your web page for any unnecessary
code that can result in reducing page size. This in turn will help in faster downloads.
Web Hosting: When you want others to see your content designed using HTML, you need to host
the content in a web server to be viewed by the public. There are several free web hosting
providers that provide free web space for your content.
116. Explain following terms
a. Snippet
b. SEO
c. CSS
Ans :
Snippet: When you want others to see your content designed using HTML, you need to host the
content in a web server to be viewed by the public. There are several free web hosting providers
that provide free web space for your content.
SEO: Search Engine Optimization or SEO refers to the process that affects the website visibility or
ranking when displaying search results. Search Engines search contents of a web page and create
indexes to display results.
CSS: Cascading Style Sheets are the templates that can be used to design your websites. These are
available on the Internet. Popularly referred to as CSS Templates or XHTML/CSS Templates these
templates look attractive while meeting certain standards.
117. Explain embedding audio in Web Pages. Give any four ways to embed audio files in a web page.
Ans: Embedding audio in Webpages: Embedding a sound on a page means to include the sound
commands in the HTML document. Four ways to embed Audio files in a web page are :
Using the Object Tag : <object> tag can be used for embedding various media into our web pages.
Google Reader MP3 Player: Google Reader has an inbuilt MP3 player that is pretty much the
same as Gmail player but it also works on non-Google websites.
Yahoo Media Player: The Yahoo Media Player takes a drastically different approach by
presenting viewers with a very minimal piece of text and a play button instead of a full-fledged
player.
MixPod: MixPod creates a free flash widget to embed into our site.
118. Give any two ways to embed flash files into a web page. Explain .mpeg, .wav and .cgm file
extensions.
Ans :
Inserting Flash into a Dreamweaver Page
Inserting Flash into Dreamweaver is a pretty straightforward process. Within Dreamweaver,
pull down the Insert menu and select Media, then select Flash
Inserting Flash into Web Pages Manually with Code:
To insert Flash onto a web page or content management system manually, we must first upload
the SWF file to a web server using a protocol called FTP or through an upload form on the content
management system.
36
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

.mpeg- MPEG files use the MPEG-1 video compression routine, a universal protocol for creating
and displaying time coded data created by the Motion Picture Experts Group.
.wav - WAV (wave) files are Microsoft's native audio sound format. WAV files can include 8-bit or
16-bit sound, in mono or stereo.
.cgm - A Computer Graphics Metafile, CGM, is also a vector format and can be opened by Canvas
and ClarisDraw.
119. Write a code in Java Script to accept a string from the user, the program should:
a. display length of the string
b. print the string in upper case
c. print the first two characters of the string
d. print the string in reverse order
Ans :
x= prompt("enter a string ");
l=x.len();
document.write(“ length of the string is : “ +l);
document.write(“ String in Uppercase is :” + x. toUpperCase());
document.write(“ First two characters of string are” + x.substring(0,2));
document.write(“ Reverse of the string is :” +x.reverse());
120. Write the code in JavaScript to accept a number from the user. It should display whether
the number entered by the user is even or odd. The code should display an alert box also
ifthe number is less than or equal to zero.
Ans :
<script>
var num;
num= prompt( enter a number”);
n=parseInt(num);
if(n<=0)
alert(“ the number is less than or equal to zero”);
if( n%2= =0)
document.write(“ number is even “);
else
document.write(“ number is odd “);
</script>
121. Give the output of the following code snippet with justification :
a) NaN % 5
b) isFinite( -Infinity)
c) “Early morning good morning”.replace(“morning”, “evening”)
d) for (i=1;i<1;i++)
document.write(“hello”);
document.write(“ByeBye”);
e) str=” Health is Wealth”;
document.write(str.match(“wealth”);
document.write(str.match(“Wealth”);
Ans :
a) NaN
b) false
c) Early evening good morning
d) ByeBye
e) null
Wealth
122. Explanation of Terms
a) MIDI: MIDI (Musical Instrument Digital Interface) is a technical standard that describes a
protocol, digital interface, and connectors that allow a wide variety of electronic musical
instruments, computers, and other related devices to connect and communicate with one
another1.
37
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

b) Helper Applications: These are external programs that a web browser can call to handle
content that the browser itself cannot process. For example, a PDF viewer or a media player
can be a helper application.
c) MixPod: MixPod was an online music playlist service that allowed users to create and share
playlists. It was popular for embedding music playlists into blogs and social media profiles.
d) Google Reader MP3 Player: This was a feature in Google Reader that allowed users to play
MP3 files directly within the feed reader. It provided a simple audio player interface for
listening to podcasts and other audio content.
e) Free Video Coding: This term generally refers to free software and tools available for video
encoding and decoding. Examples include FFmpeg, HandBrake, and Avidemux, which are used
for converting video formats, compressing video files, and other video processing tasks.
123. File Extensions
a) .mid: This is a file extension for MIDI files, which contain musical data and instructions for
playback on MIDI-compatible devices.
b) .snd: This file extension is used for sound files, typically in formats like NeXT/Sun sound
files, which store audio data.
c) .avi: AVI (Audio Video Interleave) is a multimedia container format introduced by
Microsoft, which can contain both audio and video data in a file that allows synchronous
audio-with-video playback.
d) .cvs: This seems to be a typo. The correct extension might be .csv (Comma-Separated
Values), which is a file format used to store tabular data, such as a spreadsheet or database.
e) .psd: PSD (Photoshop Document) is the default format for saving data in Adobe
Photoshop. It supports multiple layers of graphics and various imaging options.
124. JavaScript Code
a) Generate a random number greater than the entered number:
JavaScript
let userNumber = parseInt(prompt("Enter a number: "));
let randomNumber = Math.floor(Math.random() * 100) + userNumber + 1;
console.log("Random number greater than entered number: " + randomNumber);
More info on FAQ.
b) Next even number after the entered number:
JavaScript
let userNumber = parseInt(prompt("Enter a number: "));
let nextEvenNumber = userNumber % 2 === 0 ? userNumber + 2 : userNumber + 1;
console.log("Next even number: " + nextEvenNumber);
125. JavaScript Program for Marks and Grades
JavaScript
let marks1 = parseInt(prompt("Enter marks for subject 1: "));
let marks2 = parseInt(prompt("Enter marks for subject 2: "));
let marks3 = parseInt(prompt("Enter marks for subject 3: "));

let totalMarks = marks1 + marks2 + marks3;


let percentage = (totalMarks / 300) * 100;
let grade;

if (percentage >= 75) {


grade = 'A';
} else if (percentage >= 60) {
grade = 'B';
} else if (percentage >= 33) {
grade = 'C';
} else {
grade = 'D';
}

38
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

console.log("Total Marks: " + totalMarks);


console.log("Percentage: " + percentage + "%");
console.log("Grade: " + grade);
126. Possible Outputs
a) Predict the output of the HTML/JavaScript snippet:
HTML
<html>
<body>
<script>
var fruits=["Apple", "mango"];
fruits[50]= "Orange";
document.write(fruits.length);
document.write("<br> end of program");
</script>
</body>
</html>
The output will be: 51 end of program
This is because the array fruits has an element at index 50, making its length 51.
b) Rewrite using switch case:
JavaScript
switch(a) {
case 1:
document.write("Monday, Wednesday, Friday");
break;
case 2:
document.write("Tuesday, Thursday, Saturday");
break;
default:
document.write("Sunday");
}
127. JavaScript Program to Display Average Value
JavaScript
let num1 = parseFloat(prompt("Enter first number: "));
let num2 = parseFloat(prompt("Enter second number: "));
let num3 = parseFloat(prompt("Enter third number: "));
let average = (num1 + num2 + num3) / 3;
console.log("Average value: " + average);
128. Predict the Output
HTML
<html><body><script>
var str="Honesty is the best";
document.write(str.match("policy")+"<br>");
document.write(str.match("Police")+"<br>");
document.write(str.match("pollicy")+"<br>");
document.write(str.match("policy")+"<br>");
</script></body></html>
The output will be:
null
null
null
policy
This is because the match method is case-sensitive and will only find exact matches.
129. Multimedia Website
a) Internet browser that supports multimedia: Google Chrome.

39
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

b) Raster graphics: Raster graphics are images composed of pixels. An example is a JPEG
image.
c) File types:
• .au: Audio file format.
• .mpg: MPEG video file format.
130. Explanation of Terms
i) a) MIDI: MIDI (Musical Instrument Digital Interface) is a technical standard that describes
a protocol, digital interface, and connectors that allow a wide variety of electronic musical
instruments, computers, and other related devices to connect and communicate with one
another.
b) Plug-in: A plug-in is a software component that adds a specific feature to an existing
computer program. When a program supports plug-ins, it enables customization.
c) Helper Applications: These are external programs that a web browser can call to handle
content that the browser itself cannot process. For example, a PDF viewer or a media player
can be a helper application.
ii) MixPod: MixPod was an online music playlist service that allowed users to create and share
playlists. An advantage of using MixPod was its ability to embed music playlists into blogs and
social media profiles, enhancing the multimedia experience on those platforms.
131. oEmbed and Quick Media Converter
a) Three features of oEmbed:
1. Ease of Embedding: Allows websites to easily embed content such as photos, videos, and
links without needing to parse the resource directly1.
2. Standardized API: Provides a simple API for embedding media, making it easier for
developers to integrate multimedia content2.
3. Wide Support: Supported by many platforms like WordPress, Medium, and others,
allowing seamless embedding of content across different sites3.
b) Quick Media Converter: Quick Media Converter is a free video and audio conversion software
that supports a wide range of formats. It does not provide embedded code but offers a user-
friendly interface for converting media files.
132. JavaScript Script to Accept and Sort Names
JavaScript
let names = [];
for (let i = 0; i < 5; i++) {
names.push(prompt("Enter a name:"));
}
names.sort();
console.log("Sorted names: " + names.join(", "));
133. Output of the Given Code
a) The given code:
JavaScript
nm = "Fruit";
m = nm.length;
switch(m) {
case 2: document.write("two");
case 3: document.write("three");
case 4: document.write("four");
case 5: document.write("five");
case 6: document.write("six");
case 7: document.write("seven");
}
The output will be:
five
six
seven

40
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

This is because there are no break statements, so the code falls through all cases after
matching case 5.
134. JavaScript Program for Academic Category
HTML
<!DOCTYPE html>
<html>
<body>
<button onclick="assign()">Click me</button>
<script>
function assign() {
let studentClass = parseInt(prompt("Enter the class of the student:"));
let category;
if (studentClass >= 1 && studentClass <= 5) {
category = "Primary";
} else if (studentClass >= 6 && studentClass <= 8) {
category = "Middle";
} else if (studentClass >= 9 && studentClass <= 10) {
category = "Secondary";
} else if (studentClass >= 11 && studentClass <= 12) {
category = "Senior";
} else {
category = "Invalid";
}
confirm("The academic category is: " + category);
}
</script>

</body>
</html>
135. JavaScript Function with Confirm Box
JavaScript
function myfunc() {
if (confirm("Do you want to continue?")) {
alert("Thanks");
} else {
document.getElementById("demo").innerHTML = "You pressed Cancel!";
}
}
136. JavaScript Methods
a. To generate random numbers: Math.random()
b. To return the nearest integer: Math.round()
c. To return the number with the highest value: Math.max()
d. To find the position of the first occurrence of a text in a string: String.indexOf()
e. To find the length of a string: String.length
137. Lossy vs. Lossless Image Formats
• Lossy Format: Compresses image data by removing some of it, which can result in a loss
of quality. Example: JPEG.
• Lossless Format: Compresses image data without losing any quality. Example: PNG.

138. GIF and JPEG


• GIF: Graphics Interchange Format
• JPEG: Joint Photographic Experts Group
Popularity for FTP and WWW:
• GIF: Popular for its support of animations and transparency, making it ideal for simple
graphics and logos.
41
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

• JPEG: Popular for its efficient compression of photographic images, which balances
quality and file size, making it suitable for web use.
Similarity: Both GIF and JPEG are widely used image formats on the web due to their efficient
compression techniques.
139. Embedding MP3 Files into a Site
i) HTML5 <audio> tag:
HTML
<audio controls>
<source src="file.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
ii) Embedding with Flash (deprecated but still in use in some older sites):
HTML
<object type="application/x-shockwave-flash" data="player.swf">
<param name="movie" value="player.swf">
<param name="FlashVars" value="mp3=file.mp3">
</object>
iii) Using JavaScript libraries (e.g., Howler.js):
JavaScript
var sound = new Howl({
src: ['file.mp3']
});
sound.play();
iv) Embedding with iframe:
HTML
<iframe src="file.mp3" width="300" height="32"></iframe>
v) Using third-party services (e.g., SoundCloud):
HTML
<iframe width="100%" height="166" scrolling="no" frameborder="no" allow="autoplay"
src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/12
3456789&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true
&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe>
140. JavaScript Code
JavaScript
// a. Display a confirm box with the message ‘‘Do you want to continue ?’’.
confirm("Do you want to continue?");
// b. Create an array X.
let X = [ ];
// c. Store ‘‘Top’’, ‘‘Bottom’’ in the array X.
X.push("Top", "Bottom");
// d. Store Date and Time in variable B.
let B = new Date();
// e. Print the message ‘‘Welcome’’ on a web page.
document.write("Welcome");
141. Features of JavaScript
1. Dynamic Typing: Variables can hold different data types at different times.
2. Prototype-based Inheritance: Objects can inherit properties and methods from other
objects.
3. First-class Functions: Functions are treated as first-class citizens, meaning they can be
assigned to variables, passed as arguments, and returned from other functions.
4. Event-driven Programming: JavaScript supports event-driven programming, making it ideal
for interactive web applications.
5. Asynchronous Programming: JavaScript supports asynchronous programming with
callbacks, promises, and async/await syntax.
142. MIDI
42
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

MIDI: Musical Instrument Digital Interface


Advantages:
1. Compact File Size: MIDI files are much smaller than audio files because they contain
instructions rather than actual sound data.
2. Editability: MIDI data can be easily edited, allowing for changes in instrumentation, tempo,
and key without re-recording.
3. Compatibility: MIDI is a universal standard, making it compatible with a wide range of
musical instruments and software.
143. Embedding a Video in a Webpage
i) HTML5 <video> tag:
HTML
<video controls>
<source src="video.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>

ii) Embedding with iframe (e.g., YouTube):


HTML
<iframe width="560" height="315" src="https://www.youtube.com/embed/VIDEO_ID"
frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
iii) Using JavaScript libraries (e.g., Video.js):
HTML
<video id="my-video" class="video-js" controls preload="auto" width="640" height="264"
data-setup="{}">
<source src="video.mp4" type="video/mp4">
</video>
<script src="https://vjs.zencdn.net/7.11.4/video.min.js"></script>
iv) Embedding with Flash (deprecated):
HTML
<object type="application/x-shockwave-flash" data="player.swf">
<param name="movie" value="player.swf">
<param name="FlashVars" value="video=video.mp4">
</object>
v) Using third-party services (e.g., Vimeo):
HTML
<iframe src="https://player.vimeo.com/video/VIDEO_ID" width="640" height="360"
frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe>
144. Windows Movie Maker Temporary File Storage
i) Storing unsaved project data: Temporary files are used to store data for projects that are not
yet saved.
ii) Caching media files: Temporary storage is used to cache media files for faster access during
editing.
iii) Rendering previews: Temporary files are used to store rendered previews of the video
project.
145. Changing Default File Storage Location in Windows Movie Maker
i) Open Windows Movie Maker.
ii) Go to the Tools menu and select Options.
iii) In the Options dialog box, go to the General tab.
iv) Under Temporary storage, click Browse to select a new location.
v) Click OK to save the changes.
146. HTML and JavaScript for Uppercase Transformation
HTML:
HTML
<!DOCTYPE html>
<html>
43
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

<body>
<form>
Enter your name: <input type="text" id="name" onblur="toUpperCase()">
</form>
<script>
function toUpperCase() {
let input = document.getElementById("name");
input.value = input.value.toUpperCase();
}
</script>
</body>
</html>
147. HTML and JavaScript Code
HTML Code:
HTML
<!DOCTYPE html>
<html>
<head>
<title>Button Click Example</title>
</head>
<body>
<p>Click the button to trigger a function.</p>
<button onclick="displayMessage()">Click Me</button>
<p id="message"></p>

<script>
function displayMessage() {
document.getElementById("message").innerText = "Hello World";
}
</script>
</body>
</html>
148. Explain DOM with Hierarchy of Objects
The Document Object Model (DOM) is a programming interface for web documents. It
represents the page so that programs can change the document structure, style, and content.
The DOM represents the document as a tree of objects. Here’s a simplified hierarchy:
• Document: The root of the document.
• HTML: The root element of an HTML document.
o HEAD: Contains meta-information about the document.
▪ TITLE: The title of the document.
▪ META: Metadata about the document.
o BODY: Contains the content of the document.
▪ DIV: A division or section in the document.
▪ P: A paragraph.
▪ A: An anchor (link).
▪ IMG: An image.
149. Explain the Anatomy of SEO
Search Engine Optimization (SEO) involves optimizing a website to rank higher in search
engine results. Key components include:
• Keywords: Researching and using relevant keywords.
• Content: High-quality, relevant content.
• Meta Tags: Title tags, meta descriptions.
• Backlinks: Links from other websites.
• Mobile Optimization: Ensuring the site is mobile-friendly.
• User Experience: Easy navigation, fast loading times.
44
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

150. Windows Movie Maker


(a) Steps to Import Files:
1. Open Windows Movie Maker.
2. Click on “Add videos and photos” to import video and image files.
3. Click on “Add music” to import audio files.
(b) Combining Clips: Yes, NiglBas can combine two contiguous clips on the storyboard by
dragging one clip next to the other and using the “Merge” or “Combine” option.
151. HTML <EMBED> Tag
(a) What does <EMBED> do? The <EMBED> tag is used to embed multimedia content such
as audio, video, or interactive content.
(b) What does SRC signify? SRC specifies the URL of the embedded file.
c) How many times will the audio be played? Why? The audio will be played once
because LOOP=FALSE.
(d) Will the sound play automatically? Why/Why not? No, the sound will not play
automatically because AUTOSTART=FALSE.
152. JavaScript Function to Check Even or Odd
JavaScript
function checkEvenOdd(number) {
if (number % 2 === 0) {
console.log(number + " is even.");
} else {
console.log(number + " is odd.");
}
}
153. JavaScript Tasks
(a) Display Current Date and Time:
HTML
<!DOCTYPE html>
<html>
<head>
<title>Current Date and Time</title>
</head>
<body>
<p id="datetime"></p>

<script>
document.getElementById("datetime").innerText = new Date();
</script>
</body>
</html>

(b) Corrected Code for Even Numbers:


JavaScript
for (var i = 10; i <= 50; i++) {
if (i % 2 === 0) {
document.write(i + " ");
}
}

154. JavaScript Function with Prompt


HTML
<!DOCTYPE html>
<html>
<head>
45
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

<title>Greeting Message</title>
</head>
<body>
<p id="demo"></p>
<script>
function myfunc() {
var name = prompt("Please enter your name:");
if (name != null) {
document.getElementById("demo").innerText = "Hello " + name + ", Have a good day";
}
}
</script>
<button onclick="myfunc()">Click Me</button>
</body>
</html>
155. JavaScript Statements
(a) Store date and time in a variable and display on the webpage:
HTML
<!DOCTYPE html>
<html>
<head>
<title>Date and Time</title>
</head>
<body>
<p id="datetime"></p>
<script>
var currentDateTime = new Date();
document.getElementById("datetime").innerText = currentDateTime;
</script>
</body>
</html>
(i) Store the quote in a variable:
JavaScript
var quote = "Genius is one percent inspiration, 99% perspiration";
More info on FAQ.
(ii) Search for “percent” in the string and display it on the webpage:
HTML
<!DOCTYPE html>
<html>
<head>
<title>Search String</title>
</head>
<body>
<p id="searchResult"></p>
<script>
var quote = "Genius is one percent inspiration, 99% perspiration";
var searchTerm = "percent";
var searchResult = quote.includes(searchTerm) ? searchTerm : "Not found";
document.getElementById("searchResult").innerText = searchResult;
</script>
</body></html>
156. Five Ways to Embed MP3 Files into a Site
1. Using the <audio> tag:
HTML
<audio controls>
46
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

<source src="audiofile.mp3" type="audio/mpeg">


Your browser does not support the audio element.
</audio>
2. Using the <embed> tag:
HTML
<embed src="audiofile.mp3" width="300" height="50" autostart="false" loop="false">

3. Using the <object> tag:


HTML
<object data="audiofile.mp3" type="audio/mpeg" width="300" height="50">
<param name="autostart" value="false">
<param name="loop" value="false">
</object>

4. Using the <bgsound> tag (Internet Explorer only):


HTML
<bgsound src="audiofile.mp3" loop="1">
Using JavaScript:
HTML
<script>
var audio = new Audio('audiofile.mp3');
audio.play();
</script>
157. Five Ways to Embed Video in a Webpage
1. Using the <video> tag:
HTML
<video width="320" height="240" controls>
<source src="videofile.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
More info on FAQ.
2. Using the <embed> tag:
HTML
<embed src="videofile.mp4" width="320" height="240">
More info on FAQ.
3. Using the <object> tag:
HTML
<object data="videofile.mp4" width="320" height="240">
<param name="autoplay" value="false">
<param name="controls" value="true">
</object>
More info on FAQ.
4. Using an iframe (e.g., YouTube):
HTML
<iframe width="560" height="315" src="https://www.youtube.com/embed/VIDEO_ID"
frameborder="0" allowfullscreen></iframe>
More info on FAQ.
5. Using JavaScript:
HTML
<script>
var video = document.createElement('video');
video.src = 'videofile.mp4';
video.width = 320;
video.height = 240;
video.controls = true;
47
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

document.body.appendChild(video);
</script>
More info on FAQ.
158. Multimedia Elements Storage and Advantages
Storage: Multimedia elements like audio, video, and images are typically stored in files on a
server. These files can be referenced in HTML using URLs.
Advantages:
1. Enhanced User Experience: Multimedia elements can make web pages more
engaging and interactive, improving user experience.
2. Better Communication: Videos and images can convey information more effectively
than text alone, making it easier for users to understand complex concepts.
159. JavaScript Array Operations
JavaScript
var N = ["Sincerity", "Honesty"];
var M = ["Integrity", "Respect"];

// (i) Add "Patience" to the array N


N.push("Patience");
// (ii) Join array N to another array M
var combinedArray = N.concat(M);
// (iii) Delete the last element from the array M
M.pop();
// (iv) Sort the array
combinedArray.sort();
// (v) Display the array in reverse
combinedArray.reverse();
console.log(combinedArray);
160. Difference Between if…else and switch Statements
if…else:
✓ Used for conditional branching.
✓ Can handle complex conditions.
✓ Syntax:
JavaScript
if (condition) {
// code to execute if condition is true
} else {
// code to execute if condition is false
}
switch:
✓ Used for selecting one of many code blocks to execute.
✓ More readable for multiple conditions based on a single variable.
✓ Syntax:
JavaScript
switch (expression)
{
case value1:
// code to execute if expression === value1
break;
case value2:
// code to execute if expression === value2
break;
default:
// code to execute if no case matches
}
161. HTML <EMBED> Tag
48
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

(i) What is the <EMBED> tag used for? The <EMBED> tag is used to embed multimedia
content such as audio, video, or interactive content.
(ii) What is SRC used for? SRC specifies the URL of the embedded file.
(iii) What will happen if AUTOSTART is set to TRUE? The embedded content will start
playing automatically when the page loads.
(iv) What will happen if LOOP is set to FALSE? The embedded content will play only once
and will not loop.
(v) What will happen if HEIGHT and WIDTH are set to Zero (0)? The embedded content
will not be visible on the webpage.
162. Five Means of Embedding MP3 Files into a Site
1. Using the <audio> tag:
HTML
<audio controls>
<source src="audiofile.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
2. Using the <embed> tag:
HTML
<embed src="audiofile.mp3" width="300" height="50" autostart="false" loop="false">
3. Using the <object> tag:
HTML
<object data="audiofile.mp3" type="audio/mpeg" width="300" height="50">
<param name="autostart" value="false">
<param name="loop" value="false">
</object>
4. Using the <bgsound> tag (Internet Explorer only):
HTML
<bgsound src="audiofile.mp3" loop="1">
5. Using JavaScript:
HTML
<script>
var audio = new Audio('audiofile.mp3');
audio.play();
</script>
163. JavaScript Questions
(a) Include an external JavaScript file:
HTML
<script src="resource.js"></script>
(b) Function array OP():
HTML
<!DOCTYPE html>
<html>
<head>
<title>Array Operations</title>
</head>
<body>
<p id="arrayDisplay"></p>
<script>
function arrayOP() {
var array = ["BOSS", "NIGL", "JANA"];
array.push("CAMAL");
document.getElementById("arrayDisplay").innerText = array.join(", ");
}
arrayOP();
</script>
49
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

</body>
</html>
164. Embedding Audio and Video Files in a Web Page
Audio:
HTML
<audio controls>
<source src="audiofile.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
More info on FAQ.
Video:
HTML
<video width="320" height="240" controls>
<source src="videofile.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
165. JavaScript Code
(a) Display a confirm box with the message “Do you want to continue?”
JavaScript
var userResponse = confirm("Do you want to continue?");

(b) Create an array X


JavaScript
var X = [];

c) Store “Home” and “Next” in the array X


JavaScript
X.push("Home", "Next");

(d) Store Date and Time in variable B


JavaScript
var B = new Date();
(e) Print the message “Welcome” in a web-page
HTML
<!DOCTYPE html>
<html>
<head>
<title>Welcome Message</title>
</head>
<body>
<p id="welcomeMessage"></p>
<script>
document.getElementById("welcomeMessage").innerText = "Welcome";
</script>
</body>
</html>
166. Five Features of JavaScript
1. Dynamic Typing: Variables in JavaScript are not bound to any specific data type, allowing
for flexibility in coding.
2. First-Class Functions: Functions in JavaScript are treated as first-class citizens, meaning
they can be assigned to variables, passed as arguments, and returned from other functions.
3. Event-Driven Programming: JavaScript is heavily used for handling events such as user
inputs, clicks, and other interactions.
4. Prototypal Inheritance: JavaScript uses prototypes for inheritance, allowing objects to
inherit properties and methods from other objects.
50
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

5. Asynchronous Programming: JavaScript supports asynchronous programming through


callbacks, promises, and async/await, making it suitable for handling tasks like API calls
and file reading.
167. What is MIDI? Advantages of MIDI
MIDI (Musical Instrument Digital Interface) is a technical standard that describes a
protocol, digital interface, and connectors for connecting various electronic musical
instruments, computers, and other audio devices for playing, editing, and recording music.
Advantages of MIDI:
1. Compact File Size: MIDI files are much smaller than audio files because they contain
only performance data, not actual audio.
2. Editability: MIDI data can be easily edited, allowing musicians to change notes,
instruments, and other parameters without re-recording.
3. Versatility: MIDI can be used to control a wide range of electronic instruments and
devices, making it highly versatile for music production.
168. Five Ways to Embed Video in a Webpage
1. Using the <video> tag:
HTML
<video width="320" height="240" controls>
<source src="videofile.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
More info on FAQ.
2. Using the <embed> tag:
HTML
<embed src="videofile.mp4" width="320" height="240">
More info on FAQ.
3. Using the <object> tag:
HTML
<object data="videofile.mp4" width="320" height="240">
<param name="autoplay" value="false">
<param name="controls" value="true">
</object>
4. Using an iframe (e.g., YouTube):
HTML
<iframe width="560" height="315" src="https://www.youtube.com/embed/VIDEO_ID"
frameborder="0" allowfullscreen></iframe>
5. Using JavaScript:
HTML
<script>
var video = document.createElement('video');
video.src = 'videofile.mp4';
video.width = 320;
video.height = 240;
video.controls = true;
document.body.appendChild(video);
</script>
169. Interactive HTML Program with JavaScript for ABC Electronics Shop
Here’s an example of an interactive HTML program with JavaScript to calculate the cash down
price or monthly installment price for a product:
HTML
<!DOCTYPE html>
<html>
<head>
<title>ABC Electronics Shop</title>
<script>
51
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

function calculatePrice() {
var price = parseFloat(document.getElementById("price").value);
var paymentType=document.query Selector('input[name="paymentType"]: checked').
value;
var result = 0;
if (paymentType === "cash")
{
result = price * 0.95; // 5% discount
}
else
{
var years = parseInt(document.getElementById("years").value);
var interestRate = 0.05 + (years - 1) * 0.02;
result = (price * (1 + interestRate)) / (years * 12); // Monthly installment
}
document.getElementById("result").innerText = "Price: " + result.toFixed(2);
}
</script>
</head>
<body>
<h1>ABC Electronics Shop</h1>
<label for="price">Product Price:</label>
<input type="number" id="price" name="price"><br><br>
<label>Payment Type:</label><br>
<input type="radio" id="cash" name="paymentType" value="cash" checked>
<label for="cash">Cash</label><br>
<input type="radio" id="installment" name="paymentType" value="installment">
<label for="installment">Installment</label><br><br>
<div id="installmentOptions" style="display: none;">
<label for="years">Number of Years:</label>
<input type="number" id="years" name="years" min="1" value="1"><br><br>
</div>
<button onclick="calculatePrice()">Calculate</button>
<p id="result"></p>
<script>
document.querySelector('input[name="paymentType"]').addEventListener('change',
function()
{
var installmentOptions = document.getElementById("installmentOptions");
if (this.value === "installment")
{
installmentOptions.style.display = "block";
}
else
{
installmentOptions.style.display = "none";
}
}
);
</script>
</body></html>
170. Ternary Operator for Conditional Expressions in JavaScript
The ternary operator is a shorthand for the if-else statement. It takes three operands: a
condition, an expression to execute if the condition is true, and an expression to execute if the
condition is false. The syntax is:
52
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

JavaScript
condition ? exprIfTrue : exprIfFalse;
Example:
JavaScript
let age = 18;
let canVote = (age >= 18) ? "Yes" : "No";
console.log(canVote); // Output: "Yes"
In this example, if age is 18 or more, canVote will be “Yes”; otherwise, it will be "No".
171. Array Functions in JavaScript
(a) splice():
Definition: The splice() method changes the contents of an array by removing or
replacing existing elements and/or adding new elements in place.
Example:
JavaScript
let fruits = ["Apple", "Banana", "Cherry"];
fruits.splice(1, 1, "Mango");
console.log(fruits); // Output: ["Apple", "Mango", "Cherry"]
Here, “Banana” is removed and “Mango” is added at index.
(b) unshift():
Definition: The unshift() method adds one or more elements to the beginning of an
array and returns the new length of the array.
Example:
JavaScript
let fruits = ["Banana", "Cherry"];
fruits.unshift("Apple");
console.log(fruits); // Output: ["Apple", "Banana", "Cherry"]
“Apple” is added to the beginning of the array.
172. Appropriate Methods and Objects
(a) Method that returns the nearest integer value of the argument passed:
• Method: Math.round()
• Object: Math
JavaScript
let num = 4.7;
console.log(Math.round(num)); // Output: 5
(b) Method to add two arrays:
• Method: concat()
• Object: Array
JavaScript
let array1 = [1, 2, 3];
let array2 = [4, 5, 6];
let combinedArray = array1.concat(array2);
console.log(combinedArray);
// Output: [1, 2, 3, 4, 5, 6]
173. Points for Web Designers to Keep in Mind
Pradeep should consider the following points while designing a website:
1. User Experience (UX): Ensure the website is user-friendly, with intuitive navigation
and a clean, appealing design. This helps users find what they need quickly and easily4.
2. Mobile Responsiveness: Design the website to be responsive, meaning it should work
well on various devices, including smartphones and tablets. This is crucial as a
significant amount of web traffic comes from mobile devices.
174. Use of In-built Optimizer Tool of MEW
The in-built optimizer tool of My Ether Wallet (MEW) is used to optimize the gas fees
for transactions. It helps users to set the most efficient gas price, ensuring that transactions
are processed quickly and cost-effectively.
175. JavaScript Function to Return the Greater Number
53
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

Here’s a simple function that accepts two integer variables and returns the greater number:
JavaScript
function getGreaterNumber(a, b) {
return (a > b) ? a : b;
}
176. JavaScript Events
(a) onLoad
The onLoad event occurs when an object has been loaded. It is often used to execute a
script once a web page has completely loaded, including all dependent resources like images
and stylesheets.
(b) onSubmit
The onSubmit event occurs when a form is submitted. It is commonly used to validate
form data before sending it to the server.
(c) onClick
The onClick event occurs when an element is clicked. It is widely used to trigger a
function when a user clicks on a button or link.
177. JavaScript Function to Display a Hello Message
Here’s a function that uses the prompt method to accept a name and then displays a hello
message:
JavaScript
function greetUser()
{
let name = prompt("Please enter your name:");
if (name)
{
alert("Hello, " + name);
}
}
When the user enters the name “Piyush”, the output will be: Hello, Piyush.
178. Use of Web Packages and the Need for Website Backups
Web Packages:
Web packages, like Webpack, are tools used to bundle JavaScript files and other assets
for use in a browser. They help manage dependencies, optimize code, and improve the
development workflow by automating tasks like minification and transpilation.
Need for Website Backups:
Backing up a website is crucial to safeguard against data loss, hacking, accidental
deletions, or server failures. Regular backups ensure that you can quickly restore your website
to its previous state, minimizing downtime and data loss. Methods for backing up a website
include manual backups, automated backups with plugins, and hosting provider backups.
179. JavaScript Program to Calculate Percentage
Here’s a simple program to accept the marks of a student in three subjects and calculate
the percentage:
JavaScript
function calculatePercentage()
{
let subject1 = parseFloat(prompt("Enter marks for Subject 1:"));
let subject2 = parseFloat(prompt("Enter marks for Subject 2:"));
let subject3 = parseFloat(prompt("Enter marks for Subject 3:"));
let totalMarks = subject1 + subject2 + subject3;
let percentage = (totalMarks / 300) * 100;
alert("Your percentage is: " + percentage.toFixed(2) + "%");
}

54
BASKAR Lec. in Computer Science WEB APPLICATION QUESTION ANSWERS CLASS 12 CBSE

180. Predict the Output of the Code Segment


Let’s analyze the given code segment:
HTML
<html>
<script>
x = 10 + 4;
z = "HELLO" + 4;
document.write(x + + y + "<br>" + z + "<br>" + s);
</script>
</html>
x = 10 + 4 sets x to 14.
z = "HELLO" + 4 sets z to "HELLO4".
However, y and s are not defined in the script. This will cause a Reference Error for y and s.
Therefore, the output will be:
14NaN<br>HELLO4<br>undefined
The NaN (Not-a-Number) appears because y is not defined, and undefined appears for s.
181. Understanding CSS Templates and Web Authoring Tools
(a) Use of a CSS Template
➢ Consistency: CSS templates ensure a consistent look and feel across all pages of a
website, making it easier to maintain a uniform design.
➢ Efficiency: They save time and effort by providing pre-designed styles and layouts,
allowing developers to focus on content rather than design from scratch.
(b) Web Authoring Tools
Adobe Dreamweaver: A popular tool for designing, coding, and managing websites.
Microsoft Visual Studio Code: A versatile code editor with extensions for web
development, including HTML, CSS, and JavaScript support.

55

You might also like