Web Dev Exam Help
Web Dev Exam Help
today is web dev mid semester exam i give question give ans as give you previous chat like easy to
remember and easy way ans of this with sutable marks and sutabile marks, i provide question paper
of previous year
Sure! Upload the previous year's question paper, and I'll provide answers in an easy-to-remember
format along with suitable marks for each question.
Uploaded image
give ans
Here are the answers to your Advanced Web Programming mid-semester exam questions in an easy-
to-remember format with suitable marks:
javascript
✅ Definition:
Pseudo-classes in CSS define special states of an element, like `:hover`, `:focus`, `:first-child`.
✅ Example:
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 1/14
css
button:hover {
background-color: blue;
color: white;
}
input:focus {
border: 2px solid green;
}
✅ Easy Tip to Remember: `:hover` changes style on mouse over, `:focus` works when an element is
clicked.
OR
✅ Why MongoDB?
It is a NoSQL database, meaning it stores data in JSON-like format (BSON).
Scalable, fast, and flexible.
✅ Features of MongoDB:
1. Schema-less – No fixed structure like SQL.
2. Document-Oriented – Uses JSON-like documents.
3. High Performance – Faster than SQL for large datasets.
4. Horizontal Scalability – Uses Sharding to distribute data.
5. Indexing – Supports powerful indexing.
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script>
</head>
<body ng-controller="ProductController">
<table border="1">
<tr>
<th>Product Name</th>
<th>Price</th>
</tr>
<tr ng-repeat="product in products">
<td>{{ product.name }}</td>
<td>{{ product.price }}</td>
</tr>
</table>
<script>
var app = angular.module("myApp", []);
app.controller("ProductController", function($scope, $http) {
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 2/14
$http.get("products.json").then(function(response) {
$scope.products = response.data;
});
});
</script>
</body>
</html>
✅ Easy Tip to Remember: Use `$http.get()` to fetch data and `ng-repeat` to display in table format.
✅ Why SPA?
In SPA, only one HTML page loads initially, and content updates dynamically without refreshing
the page.
Uses AJAX and AngularJS routing to change views.
✅ Benefits of AngularJS:
1. Faster Performance – Only required data loads, not the whole page.
2. Two-Way Data Binding – UI updates automatically when data changes.
3. Modular Code – Uses components & controllers.
4. REST API Integration – Easily connects with backend APIs.
5. Deep Linking – Allows bookmarking of dynamic views.
OR
✅ Example:
html
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 3/14
5. Check Phase – Executes `setImmediate()` callbacks.
6. Close Callbacks Phase – Handles `close` events like `socket.on("close")`.
✅ Easy Tip to Remember: "T-I-P-P-C-C" (Timers, I/O, Poll, Prepare, Check, Close).
OR
5. Create a Node.js program for file operations (read, write, delete). (6 Marks)
✅ Code Example:
javascript
const fs = require('fs');
// Write to file
fs.writeFileSync("example.txt", "Hello, Node.js!");
// Read file
const data = fs.readFileSync("example.txt", "utf8");
console.log("File Content:", data);
// Delete file
fs.unlinkSync("example.txt");
console.log("File deleted!");
These answers are structured for easy memorization and scoring well in the exam. Let me know if you
need any modifications! 🚀🔥
Here are the easy-to-remember answers for your Advanced Web Programming exam (March 2024
paper) with suitable marks:
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 4/14
✅ AngularJS input field states:
1. $untouched – The field has not been clicked yet.
2. $touched – The field has been clicked at least once.
3. $pristine – The field has not been modified (remains in original state).
4. $dirty – The field has been modified by the user.
✅ Example in AngularJS:
html
✅ Easy Tip to Remember: "T-I-P-P-C-C" (Timers, I/O, Poll, Prepare, Check, Close).
OR
html
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-route.min.js"></scrip
</head>
<body>
<a href="#!home">Home</a> | <a href="#!about">About</a>
<div ng-view></div>
<script>
var app = angular.module("myApp", ["ngRoute"]);
app.config(function($routeProvider) {
$routeProvider
.when("/home", { template: "<h2>Welcome Home</h2>" })
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 5/14
.when("/about", { template: "<h2>About Us</h2>" });
});
</script>
</body>
</html>
html
html
css
h1 { color: green; }
✅ Advantages of CSS:
1. Faster Page Speed – CSS reduces HTML code size.
2. Easy Maintenance – Change styles in one place.
3. Improves UX – Enhances website design.
4. Responsive Design – Adapts to screen sizes.
function isPrime(num) {
if (num <= 1) return false;
for (let i = 2; i < num; i++) {
if (num % i === 0) return false;
}
return true;
}
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 6/14
✅ Easy Tip to Remember: Prime numbers are only divisible by 1 and themselves.
OR
✅ Features:
1. Asynchronous & Event-Driven – Handles multiple requests at once.
2. Single Programming Language – JavaScript for both frontend & backend.
3. Scalable – Lightweight & efficient.
4. Uses NPM (Node Package Manager) – Access to thousands of libraries.
5. Fast Execution – Powered by Google's V8 engine.
OR
<!DOCTYPE html>
<html lang="en" ng-app="employeeApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script>
</head>
<body ng-controller="EmployeeController">
<h2>Employee List</h2>
<input type="text" ng-model="search" placeholder="Search Employee">
<table border="1">
<tr>
<th>Name</th>
<th>Salary</th>
</tr>
<tr ng-repeat="emp in employees | filter:search">
<td>{{ emp.name }}</td>
<td>{{ emp.salary }}</td>
</tr>
</table>
<script>
var app = angular.module("employeeApp", []);
app.controller("EmployeeController", function($scope) {
$scope.employees = [
{ name: "John", salary: 50000 },
{ name: "Jane", salary: 60000 },
{ name: "Smith", salary: 45000 }
];
});
</script>
</body>
</html>
Final Summary:
This is easy to revise and score well in your exam! Let me know if you need further explanations. 🚀🔥
and this is some topic give info releted them : What is responsive web site, types of css,what is
pseudo class in css, angular js feature, advantages, mvc in angular, routing, data binding, services,
form handling and validation,what is single page application (SPA) , what is node js, advantage of
node, feature of node, event loop in node and it's phases, why need mongodb, CRUD operation in
mongodb
Here’s a concise and easy-to-remember explanation of each topic for your Advanced Web
Programming exam preparation:
✅ Key Techniques:
Fluid Grid – Uses percentages instead of fixed pixels.
Flexible Images – Images resize based on the screen.
Media Queries – Applies CSS rules based on device width.
Mobile-First Design – Designed for small screens first, then larger screens.
📌 Types of CSS
1. Inline CSS – Defined inside the HTML tag.
html
html
css
h1 { color: green; }
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 9/14
📌 AngularJS Features
✅ Key Features of AngularJS:
1. MVC Architecture – Follows Model-View-Controller pattern.
2. Two-Way Data Binding – Auto-updates UI when data changes.
3. Dependency Injection (DI) – Manages dependencies automatically.
4. Directives – Custom HTML elements like `ng-model`, `ng-repeat`.
5. Routing – Switch between views without reloading.
6. Filters – Modify data in UI (`uppercase`, `currency`, `date`).
7. Services – Used for reusable business logic (`$http`, `$scope`).
📌 Advantages of AngularJS
1. Easy to Use – Uses HTML + JavaScript for development.
2. Reduces Code – Uses directives and two-way data binding.
3. Fast Development – Less manual DOM manipulation.
4. Good for SPAs – Supports Single Page Applications.
5. Supports Testing – Unit testing is easy with AngularJS.
📌 MVC in AngularJS
MVC (Model-View-Controller) is a design pattern:
✅ Example:
javascript
html
📌 Routing in AngularJS
Routing helps navigate between multiple views without reloading the page.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 10/14
javascript
html
✅ Example:
html
📌 Services in AngularJS
Services are reusable functions that provide logic to controllers.
javascript
<form name="myForm">
<input type="text" ng-model="name" required>
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 11/14
<span ng-show="myForm.name.$error.required">Name is required!</span>
</form>
📌 Advantages of Node.js
1. Fast Performance – Uses Google’s V8 engine.
2. Non-blocking I/O – Handles multiple requests at once.
3. Single Language – JavaScript for both frontend & backend.
4. Scalability – Handles thousands of requests easily.
5. Huge Ecosystem – Uses NPM for third-party libraries.
📌 Features of Node.js
✅ Key Features:
Event-Driven – Uses callbacks.
Asynchronous – No waiting, executes in the background.
Single-Threaded – Handles multiple requests efficiently.
NPM – Largest package manager.
✅ Easy Tip to Remember: "T-I-P-P-C-C" (Timers, I/O, Poll, Prepare, Check, Close).
📌 Why Do We Need MongoDB?
1. NoSQL Database – Stores data in JSON format.
2. Flexible Schema – No need for fixed tables like SQL.
3. Scalable – Handles large amounts of data easily.
4. High Performance – Faster than relational databases.
✅ Example Data:
json
✅ Read (Find):
javascript
db.users.find();
✅ Update:
javascript
✅ Delete:
javascript
This quick revision guide covers everything you need for your exam preparation. Let me know if you
🚀🔥
need further clarifications!
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 13/14
ChatGPT can make mistakes. Check important info.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 14/14