CS202 — Fundamentals of Front End Development | VU Solved MCQs
CS202 Fundamentals of Front End Development covers Introduction to the Web; web standards, HTML text formatting, HTML links, HTML elements and tags, HTML lists, HTML forms, HTML images, HTML5 document structure, jQuery, Bootstrap, HTML tables, CSS selectors, CSS; adding styles, JavaScript functions. This solved post gives you 30 verified items for Virtual University of Pakistan, 10 Midterm MCQs from Lectures 1-22, 10 Finalterm MCQs from Lectures 23-45, and 5 Midterm plus 5 Finalterm subjective questions, each with its correct answer and handout reference. Practice every question instantly in the quiz for this course. Take the CS202 quiz
1. Midterm Solved MCQs
Q1. Who is making the Web standards?
A) Microsoft
B) The World Wide Web Consortium (W3C)
C) Google
D) Mozilla
Correct answer: B — The World Wide Web Consortium (W3C)
Reference: VU handout, Lectures 1–22 — Introduction to the Web; web standards.
Status: Verified
Q2. Choose the correct HTML element to define important text:
A) <strong>
B) <important>
C) <b>
D) <i>
Correct answer: A — <strong>
Reference: VU handout, Lectures 1–22 — HTML text formatting.
Status: Verified
Q3. What is the correct HTML for creating a hyperlink?
A) <a name="http://www.example.com">Example</a>
B) <a>http://www.example.com</a>
C) <a url="http://www.example.com">Example</a>
D) <a href="http://www.example.com">Example</a>
Correct answer: D — <a href="http://www.example.com">Example</a>
Reference: VU handout, Lectures 1–22 — HTML links.
Status: Verified
Q4. Which character is used to indicate an end tag?
A) ^
B) /
C) <
D) *
Correct answer: B — /
Reference: VU handout, Lectures 1–22 — HTML elements and tags.
Status: Verified
Q5. How can you open a link in a new tab/browser window?
A) <a href="url" target="new">
B) <a href="url" new>
C) <a href="url" target="_blank">
D) <a href="url" target="tab">
Correct answer: C — <a href="url" target="_blank">
Reference: VU handout, Lectures 1–22 — HTML links; target attribute.
Status: Verified
Q6. How can you make a numbered list?
A) <list>
B) <dl>
C) <ol>
D) <ul>
Correct answer: C — <ol>
Reference: VU handout, Lectures 1–22 — HTML lists.
Status: Verified
Q7. What is the correct HTML for making a checkbox?
A) <input type="checkbox">
B) <check>
C) <input type="check">
D) <checkbox>
Correct answer: A — <input type="checkbox">
Reference: VU handout, Lectures 1–22 — HTML forms.
Status: Verified
Q8. What is the correct HTML for making a dropdown list?
A) <input type="list">
B) <list>
C) <select>
D) <input type="dropdown">
Correct answer: C — <select>
Reference: VU handout, Lectures 1–22 — HTML forms.
Status: Verified
Q9. Which HTML attribute specifies an alternate text for an image, if the image cannot be displayed?
A) longdesc
B) title
C) src
D) alt
Correct answer: D — alt
Reference: VU handout, Lectures 1–22 — HTML images.
Status: Verified
Q10. Which doctype is correct for HTML5?
A) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 5.0//EN" "http://www.w3.org/TR/html5/strict.dtd">
B) <!DOCTYPE html>
C) <!DOCTYPE HTML5>
D) <!DOCTYPE html5 PUBLIC>
Correct answer: B — <!DOCTYPE html>
Reference: VU handout, Lectures 1–22 — HTML5 document structure.
Status: Verified
2. Finalterm Solved MCQs
Q1. What does jQuery primarily simplify?
A) Database management
B) HTML document traversal and manipulation
C) Graphic design
D) Network security
Correct answer: B — HTML document traversal and manipulation
Reference: VU handout, Lectures 23–45 — jQuery.
Status: Verified
Q2. Which of the following is NOT a feature of the jQuery library?
A) HTML/DOM manipulation
B) CSS manipulation
C) Video editing
D) AJAX
Correct answer: C — Video editing
Reference: VU handout, Lectures 23–45 — jQuery features.
Status: Verified
Q3. What is the purpose of the Document Ready Event in jQuery?
A) To load images faster
B) To wait for the document to be fully loaded before executing jQuery code
C) To create a new document
D) To delete the document
Correct answer: B — To wait for the document to be fully loaded before executing jQuery code
Reference: VU handout, Lectures 23–45 — jQuery; document ready.
Status: Verified
Q4. What is Bootstrap?
A) A back-end programming language
B) A front-end framework
C) A database management system
D) An operating system
Correct answer: B — A front-end framework
Reference: VU handout, Lectures 23–45 — Bootstrap.
Status: Verified
Q5. Who developed Bootstrap?
A) Bill Gates
B) Mark Otto and Jacob Thornton
C) Steve Jobs
D) Elon Musk
Correct answer: B — Mark Otto and Jacob Thornton
Reference: VU handout, Lectures 23–45 — Bootstrap.
Status: Verified
Q6. Which class is used to create a jumbotron in Bootstrap?
A) .jumbotron
B) .hero
C) .banner
D) .header-box
Correct answer: A — .jumbotron
Reference: VU handout, Lectures 23–45 — Bootstrap components.
Status: Verified
Q7. Which jQuery method is used to traverse up the DOM tree and return the direct parent element?
A) children()
B) siblings()
C) parent()
D) find()
Correct answer: C — parent()
Reference: VU handout, Lectures 23–45 — jQuery traversing.
Status: Verified
Q8. What does the $ sign represent in jQuery?
A) A variable declaration
B) A shortcut/alias for the jQuery function
C) A CSS selector
D) A string operator
Correct answer: B — A shortcut/alias for the jQuery function
Reference: VU handout, Lectures 23–45 — jQuery syntax.
Status: Verified
Q9. What is AJAX used for in web development?
A) To reload the whole web page every time data changes
B) To update parts of a web page without reloading the whole page
C) To create animations only
D) To connect to a database directly from HTML
Correct answer: B — To update parts of a web page without reloading the whole page
Reference: VU handout, Lectures 23–45 — jQuery AJAX.
Status: Verified
Q10. Which Bootstrap class creates a responsive container with fixed width that centres content?
A) .container-fluid
B) .container
C) .row
D) .col
Correct answer: B — .container
Reference: VU handout, Lectures 23–45 — Bootstrap grid system.
Status: Verified
3. Midterm Subjective
Q1. Write the HTML code to create a table with two rows and two columns, with a border.
Answer:
<table border="1">
<tr>
<td>Row 1, Column 1</td>
<td>Row 1, Column 2</td>
</tr>
<tr>
<td>Row 2, Column 1</td>
<td>Row 2, Column 2</td>
</tr>
</table>
<table> creates the table; <tr> defines a table row; <td> defines a data cell; the border attribute (in HTML5, CSS border is preferred) draws the table borders.
Reference: VU handout, Lectures 1–22 — HTML tables.
Status: Verified
Q2. What are the types of lists in HTML? Give one example of each.
Answer: (1) Ordered list <ol> — items are numbered: <ol><li>First</li><li>Second</li></ol>. (2) Unordered list <ul> — items are bulleted: <ul><li>Apple</li><li>Banana</li></ul>. (3) Definition (description) list <dl> — pairs of terms and descriptions: <dl><dt>HTML</dt><dd>HyperText Markup Language</dd></dl>. Each list item in an ordered or unordered list is written with the <li> tag.
Reference: VU handout, Lectures 1–22 — HTML lists.
Status: Verified
Q3. What are CSS selectors? Explain the element, class and id selectors with examples.
Answer: A CSS selector selects the HTML element(s) to style. (1) Element selector — selects by tag name: p { color: blue; } colours every paragraph blue. (2) Class selector — selects elements with a given class attribute, written with a dot: .note { font-size: 14px; } styles every element with class="note"; the same class can be used on many elements. (3) ID selector — selects the single element with a given id, written with a hash: #header { background: grey; } styles the element with id="header"; an id must be unique on the page. Other selectors include the universal selector * and the grouping selector (h1, h2, h3 { ... }).
Reference: VU handout, Lectures 1–22 — CSS selectors.
Status: Verified
Q4. What are the different ways to add CSS to an HTML file? Explain each briefly.
Answer: (1) Inline CSS — the style attribute on a single element: <h1 style="color: red;">Heading</h1>; it affects only that element. (2) Internal (embedded) CSS — a <style> block in the <head> of the document: <style>h1 { color: red; }</style>; it affects only that page. (3) External CSS — the rules are written in a separate .css file and linked with <link rel="stylesheet" href="style.css"> in the <head>; it can style many pages at once, which is the recommended method for a whole website because one file change updates every page.
Reference: VU handout, Lectures 1–22 — CSS; adding styles.
Status: Verified
Q5. Differentiate between the GET and POST methods of submitting a form.
Answer: Both send form data to the server, but: GET appends the form data to the URL (e.g. page.php?name=Ali&age=20), so the data is visible in the address bar, is limited in length (about 2048 characters), can be bookmarked, and is cached by the browser — it should be used only for retrieving data, never for passwords. POST sends the data in the body of the HTTP request, so it is not visible in the URL, has no practical size limit, cannot be bookmarked, and is not cached — it is used for submitting data that changes something on the server (login forms, registrations, file uploads). GET is idempotent (repeating it has the same effect); POST is not.
Reference: VU handout, Lectures 1–22 — HTML forms; GET and POST.
Status: Verified
4. Finalterm Subjective
Q1. Write a JavaScript function that takes two numbers and returns their sum. Show how it is called.
Answer:
function sum(a, b) {
return a + b;
}
var result = sum(5, 7); // result = 12
document.write(result);
A function is defined with the function keyword, a name, parameters in parentheses and a body in braces. return sends the computed value back to the caller. The function is called by its name with actual values (arguments) — here sum(5, 7) returns 12.
Reference: VU handout, Lectures 23–45 — JavaScript functions.
Status: Verified
Q2. Write the CSS code to change the text colour of Heading 1 to red and its font size to 200%.
Answer:
h1 {
color: red;
font-size: 200%;
}
The h1 element selector selects all first-level headings; color: red sets the text colour and font-size: 200% doubles the default size (percentages are relative to the parent element's font size; 32 px equals 2 em, since the default font size is 16 px). The same rule can be written inline as <h1 style="color: red; font-size: 200%;">Heading</h1>.
Reference: VU handout, Lectures 23–45 — CSS properties.
Status: Verified
Q3. How do you open and close a window in JavaScript? Give the code.
Answer: A new browser window is opened with window.open() and closed with window.close(). Example:
var myWindow = window.open("https://www.example.com", "_blank", "width=500,height=400");
myWindow.close();
window.open(url, name, features) opens a new window (or tab) and returns a reference to it; window.close() closes the window that the script opened. A script can only close a window it opened itself — browsers block scripts from closing windows the user opened.
Reference: VU handout, Lectures 23–45 — JavaScript window object.
Status: Verified
Q4. Enlist some drawbacks of JavaScript.
Answer: (1) Client-side security: JavaScript code runs on the user's machine and can be viewed (and copied) by anyone, so sensitive logic should not be put in it. (2) Browser differences: browsers may interpret JavaScript (and the DOM) differently, so code must be tested in several browsers. (3) No file access: for security reasons JavaScript in a web page cannot read or write files on the user's computer. (4) It can be disabled: if the user turns JavaScript off, the page's interactive features stop working, so the page should degrade gracefully. (5) Single-threaded: long-running scripts block the page and can make the browser appear frozen. (6) Search engines may not index JavaScript-generated content well.
Reference: VU handout, Lectures 23–45 — JavaScript; advantages and drawbacks.
Status: Verified
Q5. How many parts does a URL have? Define each part.
Answer: A URL has six parts: (1) Protocol (scheme) — how the resource is accessed, e.g. http:// or https://. (2) Host/domain name — the server's address, e.g. www.example.com. (3) Port — the port number on the server, e.g. :8080 (often omitted; the default is 80 for HTTP and 443 for HTTPS). (4) Path — the location of the resource on the server, e.g. /products/item.html. (5) Query string — parameters sent to the server, starting with ?, e.g. ?id=5&lang=en. (6) Fragment — the anchor within the page, starting with #, e.g. #section2; it is not sent to the server. Example: https://www.example.com:443/products/item.html?id=5#details.
Reference: VU handout, Lectures 23–45 — URLs.
Status: Verified
Frequently asked questions
Is the Midterm from Lectures 1-22?
Yes — Midterm covers Lectures 1-22 and Finalterm covers Lectures 23-45.
Does the quiz work from this post?
Yes — use the 'Take the CS202 quiz' link above; the quiz is already live for this course.
Are the answers verified?
Yes — all 30 items are marked Verified, solved independently and cross-checked against at least two independent sources.
More Solved Papers
See the Solved MCQs page and the midterm and finalterm mega hubs for solved papers for every subject.

Comments
Post a Comment