0% found this document useful (0 votes)
9 views

CS202

The document is a compilation of guaranteed questions and answers for the CS202 final term exam in 2024, covering various topics in programming and web development. It includes explanations of loops, jQuery events, video and audio formats, CSS properties, and differences between HTML5 and HTML. Additionally, it provides code examples for responsive design, local storage, and CSS manipulation methods.

Uploaded by

bc240433321una
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

CS202

The document is a compilation of guaranteed questions and answers for the CS202 final term exam in 2024, covering various topics in programming and web development. It includes explanations of loops, jQuery events, video and audio formats, CSS properties, and differences between HTML5 and HTML. Additionally, it provides code examples for responsive design, local storage, and CSS manipulation methods.

Uploaded by

bc240433321una
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

CS202 CURRENT SOLVED PAPER FINAL TERM 2024

GUARANTEED QUESTIONS
Join VU STUDY SOLUTIONS for more request-based assignments and
GDB and files for free. ( ‫سبِی ِل ہللا‬
َ ‫) فی‬
https://chat.whatsapp.com/LAIMHwPEHpTB1jv3cFJzQw
Question No: 1 (3 marks)
While loop and do while loop comparison
ANS:
In a while loop, the condition is checked before the loop body executes. If the condition is false initially,
the loop body may never execute.
while (condition) {
}
In a do-while loop, the condition is checked after the loop body executes. This guarantees that the loop
body executes at least once, even if the condition is false initially.
do {
}
while (condition);

Question No: 2 (3 marks)


Events of jQuery.
ANS:
All the different visitor's actions that a web page can respond to are called events. An event represents
the precise moment when something happens.
 moving a mouse over an element
 selecting a radio button
 clicking on an element

Question No: 3 (3 marks)


Video formats.
ANS:
 .ogg
 .webm
 .mp4

Question No: 3 (3 marks)


Audio formats.
ANS:
 .Wav
 .ogg
 .mp3
Question No: 4 (3 marks)
Traversing up DOM.
ANS:
Three useful jQuery methods for traversing up the DOM tree are:
parent()
parents()
parentsUntil()

Question No: 5 (3 marks)


Write syntax of text shadow in CSS3.
ANS:
h1 {
text-shadow: 2px 2px;
}

Question No: 6 (3 marks)


Describe Canvas and SVG.
ANS:
The HTML <canvas> element is used to draw graphics. The <canvas> element is only a container for
graphics. Canvas has several methods for drawing paths, boxes, circles, text, and adding images.

 SVG stands for Scalable Vector Graphics
 SVG is used to define graphics for the Web
 SVG is a W3C recommendation
The <svg> element is a container for SVG graphics. SVG has several methods for drawing paths, boxes,
circles, text, and graphic images.

Question No: 1 (5 marks)


Write the code for round corner.
ANS:
#rcorners {
border-radius: 25px;
background: brown;
padding: 20px;
width: 200px;
height: 150px;
}

Question No: 2 (5 marks)


Continue and break of JavaScript comparison.
ANS:
The continue statement is used to skip the current iteration of a loop and continue with the next iteration.
The break statement is used to exit or terminate the loop completely.
Both continue and break can be used in for, while, and do-while loops.
for (let i = 0; i < 5; i++) {
if (i === 2) {
continue;
}
console.log(i);
if (i === 3) {
break;
}
}

Question No: 3 (5 marks)


Why do we need XML DDT? Explain briefly
ANS:
XML DDT, which stands for "Data-Driven Testing," is a technique used in software testing where test
data is separated from the test scripts and stored in external data sources, often in XML format.

Used to achieve given goals


 Separation of Concerns:
 Reusable Test Scripts:
 Scalability:
 Data Integrity:

Question No: 4 (5 marks)


Write the code for responsive website, but the page of 2 columns.
ANS:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responsive Website with 2 Columns</title>
<style>
/* Styles for the columns */
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
display: flex;
flex-wrap: wrap;
}
.column {
width: 50%;
padding: 20px;
box-sizing: border-box;
}
/* Responsive styles */
@media screen and (max-width: 768px) {
.column {
width: 100%;
}
}
/* Example additional styles */
.column:nth-child(odd) {
background-color: #f0f0f0;
}
.column:nth-child(even) {
background-color: #e0e0e0;
}
</style>
</head>
<body>
<div class="container">
<div class="column">
<h2>Column 1</h2>
<p>This is the content of column 1.</p>
</div>
<div class="column">
<h2>Column 2</h2>
<p>This is the content of column 2.</p>
</div>
</div>
</body>
</html>

Question No: 1 (3 marks)


Image attributes syntax.
ANS:
<img src="image.jpg" alt="Description of the image" width="100" height="100">

Question No: 2 (3 marks)


Sliding methods of jQuery.
ANS:
 .slideDown(): Animates the height of the selected element to show it by sliding it down.
 .slideUp(): Animates the height of the selected element to hide it by sliding it up.
 .slideToggle(): Toggles between sliding up and sliding down the selected element, based on its
current visibility state.

Question No: 4 (3 marks)


Difference between HTML5 and HTML.
ANS:
HTML5 is the latest version of the HTML (Hypertext Markup Language) standard.
Here are few difference HTML5 has as compared to HTML
 New Features:
 Improved Semantics:
 Native Support for Multimedia:
 Enhanced Forms:
 Compatibility with Mobile Devices:

Question No: 5 (5 marks)


Write basic structure of HTML5
ANS:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
</head>
<body>
Content of the document......
</body>
</html>

Question No: 5 (5 marks)


What is recursive web design and development?
ANS:
Recursive web design and development refers to the practice of creating websites or web applications
that employ recursive or iterative principles in their design and development process to achieve the
following goals:
 Iterative Approach:
 Modular Design:
 Dynamic Content Generation:
 Adaptability and Scalability:
 Enhanced User Experience:
Question No: 6 (3 marks)

What is local storage ?


ANS:
With local storage, web applications can store data locally within the user's browser. Before HTML5,
application data had to be stored in cookies.
Question No: 7 (3 marks)
Write Do/While loop syntax.
ANS:
do {
// code block to be executed
}
while (condition)
Question No: 8 (3 marks)
Explain working of the following :
$(document).ready(function()
{
$("button").click(function()
{ $("p").hide();
});
});
ANS:
When a user clicks on a button, all
elements will be hidden.
Question No: 9 (3 marks)

Write output of
For(int i=11; i<20; i+=2)
{
// loop body
}
ANS:
Output
11
13
15
17
19

Question No: 10 (3 marks)


Write output of
For(i<12; i>0; i-=2)
If(i==3)
Break;
Text += i;
ANS:
12
10
8
6
4

Question No: 11 (3 marks)


Main advantage of name space XML?
Ans
To avoid Conflict between HTML and XML elements.

Question No: 12 (3 marks)


Media JQuery to set Background image device width.
@media only screen and ()
{ background-image: url('img2.jpg') 100% 100%;
}
Question No: 13 (3 marks)

Method Provide by Jquery CSS manipulation.


ANS:
jQuery Manipulating CSS jQuery has several methods for CSS manipulation.
 addClass() - Adds one or more classes to the selected elements
 removeClass() - Removes one or more classes from the selected elements
 toggleClass() - Toggles between adding/removing classes from the selected elements
 css() - Sets or returns the style attribute

Question No: 14 (3 marks)


Write syntax of word wrap& explain it.
ANS:
The CSS3 word-wrap property allows long words to be able to be broken and wrap onto the next line.
p
{
word-wrap: break-word;
}

Question No: 15 (3 marks)


ANS:
With CSS3 you can add shadow to text and to elements.
Using properties:
 text-shadow
 box-shadow

Question No: 16 (3 marks)


Write CSS3 background properties
ANS:
Some new CSS3 properties added too:
o background-size
o background-origin
o background-clip

Question No: 17 (3 marks)


write JQuery library name .
ANS:
The jQuery library contains the following features:
 HTML/DOM manipulation
 CSS manipulation
 HTML event methods
 Effects and animations

Question No: 18 (3 marks)


Enlist any three JSON point not similar with XML.
ANS:
 JSON doesn't use end tag
 JSON is shorter
 JSON is quicker to read and write
 JSON can use arrays

Question No: 19 (3 marks)


Write JQuery slide name.
ANS:
There are following jQuery Sliding Methods.
 slideDown()
 slideUp()
 slideToggle( )

Question No: 20 (3 marks)


Code to set image Width 100% and height to auto in responsive web design.
ANS:
<img src=”image.jpg” alt=”decription of the image” width=”100%” height=”auto”>

Question No: 21 (5 marks)


Purpose of Css selectors.
ANS:
$(this).hide() - hides the current element.
$("p").hide() - hides all elements.
$(".test").hide() - hides all elements with class="test".
$("#test").hide() - hides the element with id="test"

Question No: 22 (3 marks)


Different Between SVG and Canvas
ANS:

Question No: 23 (3 marks)


Five events in jQuery
ANS:
 Document ready()
 Click()
 Dblclick()
 Mouseleave()
 Mouseenter()

Question No: 24 (3 marks)
Image k tag code html5 in width and height 128 pixel .
ANS:
<image src=”html5.gif” alt=”HTML5 icon” width=”128” height=”128”>

Function square (a)


{
Sqr=a*a
Console.log(sqr)
};
Squre(2)

Function Sum (a,b,c) {


Return a+b+c
};
Sum(5,10,15)

You might also like