803 Practical File
803 Practical File
RAS AL KHAIMAH
Affiliated to CBSE Delhi (No.:6630014)
CERTIFICATE
Date:
Principal
1
INDEX
SR TOPIC PAGE NO
NO.
1. Split video clip using windows movie maker 4
2
16. Program to replace characters in a string using 22
replace() function
3
Practical -1
Solution:
Steps to split a clip: -
1) In the contents pane or on the storyboard/ timeline, click the video or audio clip
that need to be split.
2) Under the preview monitor click the play button
3) When the clip reaches a point near the place you want to split the clip click pause
4) Under the preview monitor, use the playback controls to find the point where we
want to split the clip
5) Under the preview monito click the split button.
4
Pactical-2
Question. How to Join video clip using WMM?
Solution:
The name and property information of the first clip in the group is used for the new
clip and the time is adjusted accordingly.
Tips: - We can combine more than two clips at a time as long as they are
consecutive. To select multiple clips, click the first clip, press and hold down the
SHIFT key and then click the last clip.
5
Practical: 3
Solution:
6
Practical: 4
Solution:
7
Practical: 5
Solution:
8
Practical 6
Solution:
Audio tag:- The <audio> tag defines sound such as music or other audio streams
Currently there are 3 supported file formats for the <audio> element: MP3, WAV
and OGG
9
should be loaded when the
page loads.
Src URL Specifies the URL of the audio file.
Example:-
<audio Controls>
<Source src= ”Horse.ogg”
type= “audio / ogg”>
<Source src= ”Horse.MP3”
type= “audio/ MPEG”>
your browser does not support the audio tag </audio>
BG Sound
BG Sound:- When writing in HTML the <bg sound> tag is used to embed sound files into a
web page. The sound file plays automatically when the page loads and this tag is only
supported in Internet Explorer. We recommend using the < audio> instead. The following
section contain information about the <bg sound> tag including an example of its code as
well as related attributes and browser compatibility.
Attributes
Attribute Description
Balance Designates that the audio is split between speakers. Loop
Designates that the audio file should continuously repeat.
<BG sound
src= https://www.computerhope.com/jargon/example.mp3 >
10
Practical 7
Solution:
Video Tag:- The <video> tag specifies video such as a movie clip or other video
streams
Currently there are 3 supported video formats for the <video> element MP4,
WebM OGG.
Attributes
Attribute Value Description
Autoplay Autoplay Specifies that the video will start playing as soon
as it is ready
Controls Controls Specifies that video controls should displayed (such
s a play /
pause button etc)
Height Pixels sets the height of the video player.
Loop Loop Specifies that the video will start over playing again every
time it is
finished.
Muted muted Specifies that the audio output of video should be
muted.
11
width pixels sets the width of the video player. Example:-
Solution:
Flash Files:- The <object> tag defines an embedded objects with in an HTML document.
Use this element to embed multimedia (like audio, video, java applets, actives PDF and
flash) in your web pages.
You can also use the <object> tag to embed another webpage into your HTML document.
You can use <param> tag to pass parameters to plugins that have been embedded with
the <object> tag.
Tips and Notes
Notes: - An <object> element must appear inside the <body> element. The text between
the <object> and </object> is an alternate text for browsers that do not support this tag.
Tips: -
1) For images use the <img> tag instead of the <object> tag.
2) At least one of the “Data” of “type” attribute must be defined.
Attributes
Attribute Value Description
Align top bottom Specifies the alignment of the middle left <object>
element according to
13
the registry or a URL
Codebase URL Defines where to find the code for the objects.
code type Media type The media type of the code referred to by the
classid
attribute.
data URL Specifies the URL of the resource to be used by the object
Declare Declare Defines that the object should only be declared not
created or
Height pixels specifies the height of the object Name Name specifies the
name of the object.
14
Practical 9
Question: Write a program using JavaScript for printing a line of text in a web
page Solution: Printing a line of text in a web page.
<html>
<body>
<h1> My first web page </h1>
<script>
document.write("Hello World");
</script>
</body>
</html>
Output:
15
Practical 10
Question: Write a program using JavaScript to show Date and Time in a web
page. Solution: Program to show Date and Time.
<html>
<body>
<script>
var d= new Date();
document.write(d);
</script>
</body>
</html>
Output:
16
Practical 11
Question: Write a program using JavaScript to show an alert box in a web
page. Solution: Program to show the alert box.
<html>
<script>
function Myfunction()
{
alert("Hello");
}
</script>
<body>
<input type="button" onclick="Myfunction()"
value="show me the alert box" />
</body>
</html>
Output:
17
Practical 12
Question: Write a program using JavaScript to show confirm box in a web page.
Solution: Program to show the confirm box.
<html>
<script>
function Myfunction()
{
var x=document.getElementById("demo");
var y= confirm("Press a button");
if( y == true)
answer="You pressed Ok";
else
answer= "You pressed Cancel";
x.innerHTML=answer;
}
</script>
<body>
<p> click the button to display the confirm box</p>
<button onclick="Myfunction();">Try it </button>
18
Practical 13
Question: Write a program in JavaScript to show the prompt box in a web page.
Solution: Program to show the prompt box
<html>
<script>
function Myfunction()
{
var x = document.getElementById("demo");
var person= prompt("Please enter your name");
var answer="";
if( person != null)
answer ="Hello " + person+ " how are you today!";
x.innerHTML=answer;
}
</script>
<body>
<p> click the button to display the prompt box</p>
<button onclick="Myfunction();">Try it </button>
19
Practical 14
Question: Write a program using JavaScript to find the position of the first
occurrence of a text in a string using the indexOf function.
Solution: Program to find the position of the first occurrence of a text in a
string using indexOf()
<html>
<script>
function Myfunction()
{
var x = document.getElementById("demo");
var y=document.getElementById("message").innerHTML; var z=
prompt("Please enter the character");
var answer="";
if( z != null)
answer =y.indexOf(z);
x.innerHTML=answer;
}
</script>
<body>
<p id="message"> click the button to locate where in this string a specified
character occurs</p>
<button onclick="Myfunction();">Try it </button>
<p id= "demo"></p>
</body>
</html>
Output:
20
Practical 15
Question: Write a program using JavaScript to search for a text in a string and
return the text if found using match() function.
Solution: Program to search for a text in a string and return the text if found
using the match() function.
<html>
<body>
<script>
var str="Honesty is the best policy";
document.write(str.match("policy") + "<br>");
document.write(str.match("police") + "<br>");
document.write(str.match("Policy") + "<br>");
document.write(str.match(" policy") + "<br>");
</script>
</body>
</html>
Output:
21
Practical 16
<script>
function Myfunction()
{
var str = document.getElementById("demo").innerHTML; var n=
str.replace("Hello","Good");
document.getElementById("demo").innerHTML= n;
}
</script>
<body>
<p> click the button to replace the characters</p>
<button onclick="Myfunction();">Try it </button>
<p id= "demo">Hello practicals</p>
</body>
</html>
Output:
22
Practical 17
Question: Write a program using JavaScript to round off any number to nearest integer
using round() function.
Solution: Program to round off any number using round() function.
<html>
<script>
function Myfunction()
{
var x= document.getElementById("demo").innerHTML;
x= Math.round(x);
document.getElementById("demo").innerHTML= x;
}
</script>
<body>
<p> click the button to round the number to its nearest integer</p>
<button onclick="Myfunction();">Try it </button>
<script>
function Myfunction()
{
document.getElementById("demo").innerHTML= Math.random(); }
</script>
<body>
<p> click the button to display a random number</p>
<button onclick="Myfunction();">Try it </button>
<p id= "demo"></p>
</body>
</html>
Output:
24
Practical 19
Question: Write a program using JavaScript to return a string using function.
Solution:.
<html>
<body>
<script> Program to return a string using a function
function Myfunction()
{
return "Have a nice day !!!";
}
document.write(Myfunction());
</script>
</body>
</html>
Output:
25
Practical 20
Question: Write a program using JavaScript to display the highest value of
two specified numbers using the max() function.
Solution: Program to display the number with highest value of two specified
number using max() function
<html>
<script>
function Myfunction()
{
document.getElementById("demo").innerHTML= Math.max(5,10); }
</script>
<body>
<p> click the button to display the highest no between 5 and 10</p>
<button onclick="Myfunction();">Try it </button>
</script>
<body>
<p> click the button to display the lowest no between 5 and 10</p> <button
onclick="Myfunction();">Try it </button>
<html>
<body>
<script>
var fruits= new Array();
fruits[0]= "Apple";
fruits[1]= "Mango";
fruits[2]= "Orange";
for( i=0; i< fruits.length; i++)
{
document.write(fruits[i]+"<br>");
}
</script>
</body>
</html>
Output:
28
Practical 23
Question: Write a program using JavaScript to find the length of the string.
Solution: Program to find the length of a string.
<html>
<body>
<p>length of the given string</p>
<script>
var text= "Hello World";
document.write(text.length);
</script>
</body>
</html>
Output:
29
Practical 24
Question: Write a program using JavaScript to join two arrays using Concat() function.
Solution: Program to join two arrays using Concat() function.
<html>
<script>
function Myfunction()
{
var fruits= ["Apple", "Orange"];
var vegetables= ["Cucumber", "Carrot"];
var grains= ["Wheat", "Maze"];
var mix= fruits.concat(vegetables, grains);
document.getElementById("demo").innerHTML= mix;
}
</script>
<body>
<p> click the button to join three arrays</p>
<button onclick="Myfunction();">Try it </button>
<p id= "demo"></p>
</body>
</html>
Output:
30
Practical 25
Question: Write a program using JavaScript to add a new element to the array using
push() function.
Solution: Program to add a new element to the array using push() function.
<html>
<script>
function Myfunction()
{
var names= ["Mohan", "Imran", "Leo"];
names.push("Ayush");
document.getElementById("demo").innerHTML= names;
}
</script>
<body>
<p> click the button to add a new element to the array</p>
<button onclick="Myfunction();">Try it </button>
31