Skip to content

Desktop and Web Programming

SWE · Final · Fall 25

This browser can’t show the PDF here

Open it, and your phone’s PDF viewer takes it, or download it.

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 & Information Technology Department of Software Engineering Final Examination, Fall 2025 Course Code: SE235; Course Title: Desktop and Web Programming Sections: PAS(C) MHN(A, B, F) AG(D, E) IJC(G, H) ZNM(I, J); Teachers: All Time: 2:00 Hrs Marks: 40 Answer ALL Questions [The figures in the right margin indicate the full marks and corresponding course outcomes. All portions of each question must be answered sequentially.] 1. a) Your development team has been assigned to redesign an outdated hospital appointment-management system using the .NET framework. The existing system suffers from poor separation of logic, making updates extremely risky and time-consuming. In this context, illustrate how the MVC (Model-View-Controller) design pattern works within the .NET framework, and describe the role and responsibilities of each component [Marks-5] [CLO-2, Level-3] 2. a) <!DOCTYPE html> <html> <head> <title>Product Rating</title> </head> <body> <div class="item"> <p>Laptop Pro X200</p> <button class="rate-btn">Rate Product</button> </div> <div class="item"> <p>Noise Cancelling Headset</p> <button class="rate-btn">Rate Product</button> </div> <script> // TODO: Add JavaScript code here </script> </body> </html> Develop a JavaScript function that attaches a click event listener to all <p> elements with the class text. When any paragraph is clicked: I. Change the font weight of the clicked paragraph to bold. II. Log the message "Paragraph clicked!" in the console. [Marks-5] [CLO-3, Level-6] 2. b) You are given a base JavaScript object: const userProfile = { userId: 101, username: "GuestUser", preferences: [ ], }; Reconstruct this module to create an array allUsers containing 3 user objects, where each object must include: - userId (unique number) - username (any name) - preferences (array of at least 2 items such as "darkMode", "compactView", etc. [Marks-5] [CLO-4, Level-6] 3. a) <?php class Account { protected $balance; public function __construct($balance = 0) { $this->balance = $balance; } // TODO: Implement deposit() } class SavingsAccount extends Account { private $interestRate; public function __construct($balance, $rate) { parent::__construct($balance); $this->interestRate = $rate; } // TODO: Override a method to include interest in the final balance } ?> Tasks: 1. Implement deposit(amount) and withdraw(amount) inside Account. 2. Override a method in SavingsAccount so that it calculates the final balance including interest. 3. Create an object of SavingsAccount with a starting balance of 1000 and interest rate 0.05, call deposit then print the final balance. [Marks-10] [CLO-4, Level-6] 3. b) <?php function countCharacter($str) { // TODO: Return Odd or Even depending on the number of character } $input = "DesktopAndWeb"; echo countCharacterFrequency($input); ?> Construct the solution so that the function returns an associative array indicating how many times each character appears in the string. [Marks-5] Below is a defective PHP + MySQL module for managing a Movie Database. It should allow an admin to add and delete movies, but contains logical issues and missing lines. <?php $connection = mysqli_connect("localhost", "root", "", "moviesdb"); // TODO: Missing validation & SQL handling if(isset($_POST['add'])) { title = $_POST['title']; $year = $_POST['year']; // INSERT query missing } if(isset($_POST['delete'])) { $movieId = $_POST['movieId']; // DELETE query missing } ?> <form method="POST"> <h3>Add Movie</h3> <input type="text" name="title" placeholder="Title"><br> <input type="number" name="year" placeholder="Year"><br> <button name="add">Add Movie</button> </form> <h3>Delete Movie</h3> <input type="number" name="movieId" placeholder="Movie ID"><br> <button name="delete">Delete Movie</button> </form> Construct a correct and complete PHP application that: 1. Performs INSERT and DELETE operations. 2. Validates that fields are not empty. 3. Displays meaningful success/error messages. 4. Uses proper MySQL query execution. [Marks-10]