Skip to content
VUBuddy

CS511 Final Term Past Papers Fall 2024 by Usama Farooq

Web Engineering PDF 947 KBUpdated 23 Oct 2026
Final term past paper CS511 Final Term Past Papers Fall 2024 by Usama Farooq PDF 947 KB
vubuddy.com
Type
Final term past paper
Course
CS511 Web Engineering
Size
PDF 947 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 947 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2, 3 of 4. Download the file for all 4 pages.

CS511 – Web Engineering · Final Terms, Fall 2024 · +92 318 1683 839

Q1. Write names of HTTP methods used in web service?

  1. Create PHP script aƩempts to connect a database.
  2. Write PHP code that check cookies user name is set.

Q4. Write three paƩern names in design of web page?

  1. Write two names of development stacks in which we use Node.js as backend server.
  2. PHP code for class name student.

Q7. How to create a table in Laravel?

Q8. For which purpose serializaƟon used?

Q9. BookID colum 1 and colum 2 how book name will be stored?

  1. Explain XHTML and write syntax.
  2. Different event handling approaches in JavaScript.
  3. Difference between GET and POST in AJAX.
  4. Purpose of PHP superglobal variables.
  5. Role of jQuery in web development.
  6. What are jQuery selectors? Provide an example.

Q16. How does PHP handle form validaƟon?

Q17. What is the purpose of serialize() in jQuery AJAX?

Q18. What is object-oriented programming in PHP?

Q19. What is the difference between JSON and XML?

  1. Explain the difference between fadeIn(), slideDown(), and animate() in jQuery.

Q21. What is the difference between synchronous and asynchronous requests in AJAX?

  1. What are superglobal variables in PHP? Name at least four.

Q23. What is the purpose of isset() and empty() funcƟons in PHP?

Q24. What is the difference between append(), prepend(), before(), and aŌer() in jQuery?

Q25. What is the difference between innerHTML, textContent, and innerText in JavaScript?

  1. Create a PHP class with methods and properƟes.
  2. Write a PHP code and apply switch in it.
  3. If HTML code given, in the paragraph separate data was wriƩen in the tags, so with the help of jQuery, the first paragraph had to be wriƩen in place of the data: ‘Virtual University of Pakistan’.

Q4. Write PHP script to start a session and check if a user is logged in?

  1. Write a JavaScript program to validate a form with fields (name, email, password).
  2. Explain jQuery animaƟons with an example. Implement a buƩon that fades in text when clicked.
  3. Explain how you would parse JSON data in PHP and display it on a webpage.
  4. Explain AJAX with an example that fetches and displays user details from a server without reloading the page.

Answers:

  1. HTTP methods used in web service: GET, POST, PUT, DELETE.

2. PHP script to connect to a database:

<?php $servername = "localhost"; $username = "root"; $password = ""; $dbname = "mydatabase";

// Create connection $conn = new mysqli($servername, $username, $password, $dbname);

// Check connection if ($conn->connect_error) { die(" Connection failed: " . $conn->connect_error);

echo " Connected successfully";

3. PHP code to check if a cookie named "username" is set:

php CopyEdit <?php if(isset($_COOKIE['username'])) { echo " Username: " . $_COOKIE['username']; } else { echo " Cookie is not set!";

  1. Three design paƩerns for web page design: Adapter PaƩern, Simple Factory PaƩern, Template Method PaƩern
  2. Two development stacks using Node.js: MEAN (MongoDB, Express.js, Angular, Node.js) and MERN (MongoDB, Express.js, React, Node.js).

6. PHP class named "Student":

<?php class Student { public $name; public $age;

function set_name($name) { $this->name = $name;

function get_name() { return $this->name;

7. CreaƟng a table in Laravel:

php artisan make:migration create_students_table

Then, inside the migraƟon file:

public function up()

Schema::create('students', function (Blueprint $table) { $table->id(); $table->string('name'); $table->integer('age'); $table->timestamps();

Run migraƟon with:

php artisan migrate

  1. Purpose of serializaƟon: It is used to convert objects into a format (like JSON or XML) that can be easily stored or transmiƩed.
  2. How book names are stored with BookID column 1 and 2: It depends on the database design; usually, a relaƟonal approach with a " Books" table storing BookID and BookName is used.
  3. XHTML explanaƟon and syntax: XHTML is a stricter version of HTML with proper nesƟng and closing tags.

Example:

<!DOCTYPE html>

<head><title>XHTML Example</title></head> <body><p> Hello World!</p></body> </html>

  1. Event handling approaches in JavaScript: Inline events, tradiƟonal event handlers, event listeners (e.g., addEventListener).
  2. Difference between GET and POST in AJAX: GET is used for retrieving data, while POST is used for sending data securely.
  3. Purpose of PHP superglobal variables: These are built-in variables like $_GET, $_POST, $_SESSION, $_COOKIE used to access request and session data.
  4. Role of jQuery in web development: It simplifies DOM manipulaƟon, AJAX requests, and animaƟons.

15. jQuery selectors example:

$("p").hide(); // Hides all <p> elements

  1. How PHP handles form validaƟon: By using isset(), empty(), and regular expressions to check input fields.
  2. Purpose of serialize() in jQuery AJAX: Converts form data into a query string format.
  3. Object-oriented programming in PHP: Uses classes and objects to encapsulate data and behavior.
  4. Difference between JSON and XML: JSON is lightweight and faster, while XML is more structured and widely used in SOAP web services.

20. Difference between fadeIn(), slideDown(), and animate() in jQuery:

o fadeIn(): Fades in an element.

o slideDown(): Slides down an element.

o animate(): Custom animaƟons.

  1. Difference between synchronous and asynchronous AJAX requests: Synchronous waits for a response before proceeding; asynchronous allows execuƟon to conƟnue while waiƟng for the response.
  2. Four superglobal variables in PHP: $_GET, $_POST, $_SESSION, $_COOKIE.

23. Purpose of isset() and empty() funcƟons in PHP:

o isset(): Checks if a variable is set and not null.

o empty(): Checks if a variable is empty.

24. Difference between append(), prepend(), before(), and after() in jQuery:

o append(): Adds content inside an element at the end.

o prepend(): Adds content inside an element at the beginning.

o before(): Inserts content before an element.

o after(): Inserts content aŌer an element.

25. Difference between innerHTML, textContent, and innerText in JavaScript:

o innerHTML: Includes HTML formaƫng.

o textContent: Plain text without formaƫng.

o innerText: Similar to textContent, but may vary slightly between browsers.

1. PHP class with methods and properƟes:

<?php class Car { public $brand; public $model; public $year;

function __construct($brand, $model, $year) { $this->brand = $brand; $this->model = $model; $this->year = $year;

function getCarDetails() { return "$this->brand $this->model ($this->year)";

$car1 = new Car(" Toyota", " Corolla", 2022); echo $car1->getCarDetails();

All CS511 files →
CS511 Web Engineering All CS511 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.