Desktop and Web Programming
SWE · Quiz · Fall 26
Paper 3 of 4Section C · Batch 44 · Jobayer Ahmed Usamah - SWE (251) (2)Switch
Section C · Batch 44
Paper 3 of 4
Read the questions as text
Read off the PDF by AI, so it may have mistakes. The PDF is the original.
Daffodil International University
Faculty of Science & Technology
Department of Software Engineering
Course Code: SE 235 Course Title: Web & Desktop Programming
Quiz 2 – Section C
Total Marks: 15
Time: 40 minutes
Question 1: CSS Flexbox (5 Marks)
Consider the following HTML and CSS code. Draw or describe the final layout of the three boxes and explain how the Flexbox properties affect their positions.
<div class="container">
<div>A</div>
<div>B</div>
<div>C</div>
</div>
.container {
display: flex;
flex-direction: row-reverse;
justify-content: space-evenly;
align-items: flex-start;
height: 220px;
width: 640px;
}
.container div {
width: 70px;
height: 40px;
}
Question 2: CSS Grid (5 Marks)
Analyze the following HTML and CSS code. Draw the resulting grid layout, showing the position of each item, and explain how the column sizes and grid-column property affect the layout.
<div class="grid-container">
<div>A</div>
<div>B</div>
<div>C</div>
<div>D</div>
<div>E</div>
</div>
.grid-container {
display: grid;
grid-template-columns: 1fr 1fr 2fr;
gap: 12px;
}
.grid-container div:nth-child(4) {
grid-column: span 2;
}
Question 3: JavaScript DOM Manipulation (5 Marks)
Analyze the following HTML and JavaScript code. Determine the final heading and paragraph contents after the button is clicked, and explain which elements are modified by the DOM operations.
<h2 class="heading">Hello</h2>
<p class="info">HTML</p>
<p class="info">CSS</p>
<p class="info">JavaScript</p>
<button onclick="changeContent()">Update</button>
<script>
function changeContent() {
document.getElementsByTagName("h2")[0].innerHTML =
"Responsive Design";
let items = document.getElementsByClassName("info");
items[0].innerHTML = "Bootstrap";
items[1].innerHTML = "Media Queries";
}
</script>
— End of Quiz —