0% found this document useful (0 votes)
15 views8 pages

24CS102 Model Exam Answer Key

The document is an answer key for a model exam on Software Development Practices, covering topics such as the Evolutionary Process Flow Diagram, Agile Unified Process, HTTP GET Requests, and server-side scripting. It includes definitions, examples, and code snippets related to various programming concepts and methodologies. Additionally, it provides HTML and JavaScript examples for practical applications in web development.
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)
15 views8 pages

24CS102 Model Exam Answer Key

The document is an answer key for a model exam on Software Development Practices, covering topics such as the Evolutionary Process Flow Diagram, Agile Unified Process, HTTP GET Requests, and server-side scripting. It includes definitions, examples, and code snippets related to various programming concepts and methodologies. Additionally, it provides HTML and JavaScript examples for practical applications in web development.
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/ 8

24CS102 – Software Development Practices

Model Exam 2024-25


Answer Key
1. Draw the Evolutionary Process Flow Diagram
The Evolutionary Process Flow Diagram illustrates the iterative nature of development, such as in
Spiral or Incremental models. It includes phases like:
● Requirement Analysis
● Design
● Development
● Testing
● Release
Diagram should be drawn

2. Define Agile Unified Process (AUP)


The Agile Unified Process is a simplified version of the Rational Unified Process (RUP) that adopts
agile practices. It divides development into phases:
● Modeling
● Implementation
● Testing
● Deployment
● Configuration Management
● Project Management
● Environment Setup
AUP emphasizes iterative development, team collaboration, and customer feedback.

3. List the Uses of HTTP GET Request


● Retrieve data from a server.
● Perform safe, read-only operations (idempotent).
● Pass data via URL parameters.
● Cacheable by browsers.
Example: GET /api/users?id=123 HTTP/1.1

4. Define Server-Side Scripting


Server-side scripting involves executing scripts on a web server to generate dynamic web content. It
interacts with databases, processes user input, and delivers tailored responses.
Examples: PHP, Node.js, Python (Django/Flask).

5. List Any Four Font Families and Give Examples


1. Serif: Times New Roman
2. Sans-Serif: Arial
3. Monospace: Courier New
4. Cursive: Brush Script
Example usage in CSS:
body {
font-family: 'Arial', sans-serif;
}
6. Relate Linear Gradient and Radial Gradient
Both are CSS properties used to create gradient effects:
● Linear Gradient: A gradual blend of colors along a straight line.
css
background: linear-gradient(to right, red, blue);
● Radial Gradient: Colors blend outward in a circular or elliptical shape.
css
background: radial-gradient(circle, red, blue);

7. Define Global Variable with an Example


A global variable is accessible throughout the entire program or script.
Example in JavaScript:
javascript
var globalVar = "Hello, World!";
function printGlobalVar() {
console.log(globalVar);
}
8. Give an Example for Declaring and Allocating Arrays
Example in C:
int arr[5]; // Declaration of an integer array with 5 elements
arr[0] = 10; // Allocation of values
Example in JavaScript:
javascript
Copy code
let arr = [1, 2, 3, 4, 5];

9. List the Four DOM Collections


1. document.images: Collection of all images in the document.
2. document.forms: Collection of all forms in the document.
3. document.links: Collection of all <a> and <area> elements with href attributes.
4. document.scripts: Collection of all script elements.

10. Define Event Bubbling


Event bubbling is a process in which an event starts at the most specific target element and propagates
upward to the least specific ancestor elements in the DOM hierarchy.

Part - B
11.a. Adaptive Software Development and Scrum
Adaptive Software Development (ASD):
ASD is a software development methodology that focuses on iterative learning and adaptation. Key
phases:
● Speculate: Initial planning and exploration.
● Collaborate: Teamwork and communication to handle changes.
● Learn: Continuous reflection and improvement.
Scrum:
Scrum is an Agile framework with roles (Scrum Master, Product Owner, Development Team), events
(Sprints, Daily Standups, Sprint Reviews), and artifacts (Product Backlog, Sprint Backlog). It
emphasizes iterative development and collaboration.

11.b. Branch Management in Git


Branching allows multiple developers to work on different features concurrently. Example:
# Create and switch to a new branch
git branch feature-branch
git checkout feature-branch

# Merge branch into main


git checkout main
git merge feature-branch

# Delete a branch
git branch -d feature-branch
Tips:
● Use meaningful branch names.
● Regularly merge main into feature branches to avoid conflicts.

12.a. HTML5 Document with Nested Lists


html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Nested List</title>
</head>
<body>
<h1>Favorite Frozen Desserts</h1>
<ol>
<li>Ice Cream
<ul>
<li>Vanilla</li>
<li>Chocolate</li>
<li>Strawberry</li>
</ul>
</li>
<li>Soft Serve
<ul>
<li>Twist</li>
<li>Cookies and Cream</li>
<li>Mint</li>
</ul>
</li>
<li>Frozen Yogurt
<ul>
<li>Blueberry</li>
<li>Mango</li>
<li>Peach</li>
</ul>
</li>
</ol>
</body>
</html>

12.b. HTML5 Code with Page Structure Elements


html
<!DOCTYPE html>
<html>
<head>
<title>HTML5 Page Structure</title>
</head>
<body>
<header>
<h1>Welcome to My Website</h1>
</header>
<main>
<p>This is the main content area.</p>
</main>
<footer>
<p>&copy; 2024 My Website</p>
</footer>
</body>
</html>

13.a. Multicolumn Page with Media Queries


html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Multi-column Page</title>
<style>
.container {
column-count: 3;
column-gap: 20px;
}
@media (max-width: 480px) {
.container {
column-count: 1;
}
}
</style>
</head>
<body>
<div class="container">
<p>Column 1 content...</p>
<p>Column 2 content...</p>
<p>Column 3 content...</p>
</div>
</body>
</html>

13.b. Transitions and Transformations Example


html
<!DOCTYPE html>
<html lang="en">
<head>
<title>CSS Transitions and Transformations</title>
<style>
.box {
width: 100px;
height: 100px;
background-color: red;
transition: transform 0.5s, background-color 0.5s;
}
.box:hover {
transform: rotate(45deg) scale(1.2);
background-color: blue;
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>

14.a. Script for Integer Operations


javascript
let num1 = parseInt(prompt("Enter first integer:"));
let num2 = parseInt(prompt("Enter second integer:"));
let num3 = parseInt(prompt("Enter third integer:"));

let sum = num1 + num2 + num3;


let average = sum / 3;
let product = num1 * num2 * num3;
let smallest = Math.min(num1, num2, num3);
let largest = Math.max(num1, num2, num3);

alert(`Sum: ${sum}
Average: ${average}
Product: ${product}
Smallest: ${smallest}
Largest: ${largest}`);

14,b.JavaScript Functions and Passing Arrays


A JavaScript function is a reusable block of code designed to perform a specific task. Functions
improve code modularity and reusability, allowing developers to break down complex problems into
smaller, manageable parts.
Key Features of Functions
1. Encapsulation: Functions encapsulate code into reusable units.
2. Parameters and Arguments: Functions accept parameters to customize behavior.
3. Return Values: Functions can return results to the caller.
4. Scope: Variables declared within a function are local to that function.
Syntax of a Function
javascript
function functionName(parameter1, parameter2) {
// Function body
return result; // Optional
}
Passing Arrays to Functions
Arrays in JavaScript are passed to functions by reference, meaning the function gets access to the
original array and can modify its contents. This behavior is useful for processing or updating data
efficiently.
Example: Passing Arrays to Functions
javascript
function printArray(arr) {
arr.forEach(element => {
console.log(element);
});
}

// Declare an array
let numbers = [10, 20, 30];

// Pass the array to the function


printArray(numbers);
Modifying an Array Within a Function
javascript
function addElement(arr, element) {
arr.push(element); // Modifies the original array
}

let fruits = ["Apple", "Banana"];


addElement(fruits, "Cherry");
console.log(fruits); // Output: ["Apple", "Banana", "Cherry"]
Returning Processed Arrays
Functions can also return new arrays instead of modifying the original:
javascript
function doubleValues(arr) {
return arr.map(num => num * 2);
}

let numbers = [1, 2, 3];


let doubled = doubleValues(numbers);
console.log(doubled); // Output: [2, 4, 6]
Advantages of Passing Arrays to Functions
1. Efficiency: Arrays allow bulk data processing in a single function call.
2. Flexibility: Functions can modify or return processed arrays based on requirements.
3. Modularity: Operations on arrays can be isolated into reusable functions.
Let me know if you'd like additional examples or explanations!

15.a. Traversing and Modifying a DOM Tree with example program


Traversing: Navigating between nodes (parent, child, sibling).
Modifying: Adding, removing, or updating elements.
15.b. Function for Click Event Handling
Here’s a JavaScript function that responds to clicks on the page, displaying specific messages based
on the keys held during the click:
html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Click Event Handler</title>
<script>
function handleClick(event) {
if (event.shiftKey) {
alert(`Event Name: ${event.type}`);
} else if (event.ctrlKey) {
alert(`Element Name: ${event.target.tagName}`);
} else {
alert("You clicked somewhere on the page!");
}
}

// Add event listener to the entire page


document.addEventListener("click", handleClick);
</script>
</head>
<body>
<h1>Click Anywhere</h1>
<p>Hold Shift or Ctrl while clicking to see special responses.</p>
</body>
</html>

16.a. HTML5 Code for Department Webpage


Here’s a basic example for a department webpage:
html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Department Page</title>
<style>
body {
font-family: Arial, sans-serif;
}
header, footer {
background-color: #004080;
color: white;
padding: 10px;
text-align: center;
}
main {
padding: 20px;
}
nav {
background-color: #f0f0f0;
padding: 10px;
}
nav a {
margin: 0 10px;
text-decoration: none;
color: #004080;
}
</style>
</head>
<body>
<header>
<h1>Department of Computer Science</h1>
</header>
<nav>
<a href="#">Home</a>
<a href="#">About</a>
<a href="#">Contact</a>
</nav>
<main>
<h2>About Us</h2>
<p>The Department of Computer Science offers cutting-edge education and research
opportunities in areas such as Artificial Intelligence, Data Science, and Cybersecurity.</p>
<h3>Our Courses</h3>
<ul>
<li>Data Structures</li>
<li>Machine Learning</li>
<li>Cloud Computing</li>
</ul>
</main>
<footer>
<p>&copy; 2024 Department of Computer Science</p>
</footer>
</body>
</html>
Sample Webpage Layout:
● Header with the department name.
● Navigation bar with links.
● Main content with details about the department and its offerings.
● Footer for copyright information.

16.b. Script for Credit Limit Check


html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Credit Limit Check</title>
<script>
function checkCreditLimit() {
let accountNumber = prompt("Enter Account Number:");
let beginningBalance = parseInt(prompt("Enter Beginning Balance:"));
let charges = parseInt(prompt("Enter Total Charges:"));
let credits = parseInt(prompt("Enter Total Credits:"));
let creditLimit = parseInt(prompt("Enter Allowed Credit Limit:"));

// Calculate new balance


let newBalance = beginningBalance + charges - credits;

// Display the result


let message = `Account Number: ${accountNumber}\nNew Balance: ${newBalance}`;
if (newBalance > creditLimit) {
message += "\nCredit Limit Exceeded!";
document.body.innerHTML = `<h1 style="color:red;">Credit Limit Exceeded</h1>`;
} else {
alert(message);
}
}
</script>
</head>
<body>
<h1>Credit Limit Checker</h1>
<button onclick="checkCreditLimit()">Check Credit Limit</button>
</body>
</html>

You might also like