Database Management System BCA fourth Semester TU

Database Management System BCA TU Database Management System BCA TU a comprehensive Guides: Database Management System Concepts Quiz Next Reset Quiz Unit 1: Introduction to DBMS Unit 1: Introduction to DBMS 1. Introduction to Database Management System (DBMS) A Database Management System (DBMS) is a software system designed to store, retrieve, define, and manage data … Read more

Software Engineering BCA fourth Semester TU

Software Engineering BCA TU

Software Engineering Concepts Quiz



1.Introduction :

Introduction to Software Engineering


Definition of Software

Software is a collection of programs, data, and related documentation that performs specific tasks or functions for users. It is intangible and serves as the core element enabling computers and devices to perform operations.


Types of Software

  1. System Software:

    • Manages hardware and provides a platform for other software.
    • Examples: Operating Systems (Windows, Linux), Utility Programs.
  2. Application Software:

    • Designed to perform specific user tasks.
    • Examples: Microsoft Word, Google Chrome.
  3. Embedded Software:

    • Operates within hardware devices to control functionalities.
    • Examples: Software in washing machines, medical devices.
  4. Middleware:

    • Acts as a bridge between system software and applications.
    • Example: Database middleware.
  5. Programming Software:

    • Provides tools for developers to write and test programs.
    • Examples: Compilers, Debuggers.

Characteristics of Software

  1. Functionality: Performs specified tasks as expected.
  2. Reliability: Operates consistently under defined conditions.
  3. Usability: Easy to learn and use.
  4. Efficiency: Optimized use of system resources (e.g., memory, CPU).
  5. Maintainability: Easy to update and improve.
  6. Portability: Ability to function across different platforms.

Attributes of Good Software

  1. Correctness: Accurately performs its intended tasks.
  2. Scalability: Can handle increasing amounts of work or data.
  3. Interoperability: Works seamlessly with other software.
  4. Security: Protects against unauthorized access and vulnerabilities.
  5. Adaptability: Can be modified to meet changing requirements.

Definition of Software Engineering

Software Engineering is the application of engineering principles to the design, development, testing, and maintenance of software. It emphasizes systematic, disciplined, and measurable approaches to software creation and management.


Software Engineering Costs

  1. Development Costs: Effort involved in designing, coding, and testing.
  2. Operational Costs: Running and maintaining the software.
  3. Maintenance Costs: Updating the software to adapt to changes or fix issues.
  4. Quality Assurance Costs: Ensuring the software meets standards and requirements.

Key Challenges in Software Engineering

  1. Meeting User Requirements: Addressing complex and evolving needs.
  2. Managing Cost and Time: Delivering within budget and deadlines.
  3. Ensuring Quality: Delivering software that is reliable, efficient, and secure.
  4. Scalability and Performance: Designing systems to handle growth.
  5. Changing Technology: Adapting to rapid advancements in tools and platforms.
  6. Global Collaboration: Managing teams distributed across geographies.

System Engineering vs. Software Engineering

Aspect System Engineering Software Engineering
Focus Entire system, including hardware, software, and processes. Software components of the system.
Scope Broader, encompassing multiple disciplines. Narrower, focusing solely on software.
Outputs System specifications and designs. Software programs and related documents.

Professional Practice in Software Engineering

  1. Ethical Standards: Adhering to codes of conduct to ensure fairness, honesty, and integrity.
  2. Team Collaboration: Working effectively with cross-functional teams.
  3. Lifelong Learning: Keeping skills updated with the latest trends and technologies.
  4. Documentation: Maintaining clear and thorough records of designs, processes, and decisions.
  5. Risk Management: Identifying, analyzing, and mitigating project risks.

Software engineering plays a critical role in modern technology, ensuring that software systems are efficient, reliable, and scalable while meeting user expectations and organizational needs.

Read more

Scripting Language BCA fourth semester TU

Scripting Language BCA TU

Scripting language BCA TU comprehensive guides

Scripting Language Concepts Quiz



1. Client Side Scripting :


1. Client-Side Scripting (15 hrs)

JavaScript: Introduction, Need of Client-Side Scripting Language, and Related Concepts

Introduction:

  • JavaScript is a lightweight, interpreted, or just-in-time compiled programming language. It is primarily used for adding interactivity to web pages, enabling client-side scripting on the user's browser.
  • JavaScript can manipulate the DOM (Document Object Model), handle events, validate forms, and create animations, among other things.

Need of Client-Side Scripting Language:

  • Enhanced User Experience: Client-side scripting languages like JavaScript enable interactive web pages. For instance, you can modify the content of the webpage dynamically without needing to reload the page.
  • Performance: By moving processing to the client (browser), JavaScript reduces server load and speeds up the response time of the application.
  • Cross-Platform Compatibility: JavaScript runs on almost all browsers and platforms, providing universal compatibility.
  • Asynchronous Operations: JavaScript can handle asynchronous operations (e.g., loading content in the background) using technologies like AJAX, which helps in creating dynamic and faster web applications.

Formatting and Coding Conventions:

Adhering to formatting and coding conventions ensures that the code is clean, readable, and maintainable. Some common conventions are:

  • Indentation: Use consistent indentation (e.g., 2 spaces or 4 spaces per level) for better readability.
  • Naming Conventions: Use camelCase for variable and function names (e.g., myFunction, userData).
  • Comments: Use comments to describe your code for others and yourself.

JavaScript Files:

  • External JavaScript Files: To maintain clean code and improve performance, JavaScript is often written in external files and linked to HTML files using the <script> tag.

    Example:

    <script src="script.js"></script>
    

Comments in JavaScript:

  • Single-line comments start with //.
  • Multi-line comments are enclosed between /* and */.
// This is a single-line comment

/* 
This is a 
multi-line comment
*/

Embedding JavaScript in HTML:

JavaScript can be embedded directly within an HTML document using the <script> tag.

<!DOCTYPE html>
<html>
<head>
  <title>JavaScript Example</title>
</head>
<body>

  <h1>Welcome to JavaScript</h1>
  
  <script>
    alert("Hello, world!");
  </script>

</body>
</html>

Using the <script> Tag:

  • The <script> tag is used to embed JavaScript code within an HTML document. It can be placed in the <head> or <body> section.
  • JavaScript code in the <head> is loaded before the body, while JavaScript in the <body> is executed after the content is loaded.
<script>
  console.log("This is a message.");
</script>

NoScript Tag:

  • The <noscript> tag is used to provide alternative content for users who have JavaScript disabled in their browsers.
<noscript>
  <p>Your browser does not support JavaScript or it is disabled.</p>
</noscript>

Operators in JavaScript:

Operators are symbols that perform operations on variables or values.

  • Arithmetic Operators: Used to perform mathematical operations.
    • + (addition), - (subtraction), * (multiplication), / (division), % (modulus)
let x = 10;
let y = 5;
console.log(x + y);  // Output: 15
  • Comparison Operators: Used to compare values.
    • == (equal to), != (not equal), > (greater than), < (less than), >= (greater than or equal to)
console.log(5 == 5);  // true
console.log(5 != 10); // true
  • Logical Operators: Used to combine conditions.
    • && (AND), || (OR), ! (NOT)
let a = true, b = false;
console.log(a && b); // false

Control Structures in JavaScript:

Control structures dictate the flow of the program.

  • If-Else Statement: A conditional structure that executes code based on a condition.
let age = 18;
if (age >= 18) {
  console.log("Adult");
} else {
  console.log("Minor");
}
  • Switch-Case: A control structure that evaluates an expression and matches it with different cases.
let fruit = "apple";
switch (fruit) {
  case "apple":
    console.log("It's an apple.");
    break;
  case "banana":
    console.log("It's a banana.");
    break;
  default:
    console.log("Unknown fruit.");
}
  • Loops (For, While, Do-While): Used for repeated execution.
// For loop
for (let i = 0; i < 5; i++) {
  console.log(i); // Outputs numbers from 0 to 4
}

// While loop
let j = 0;
while (j < 5) {
  console.log(j); // Outputs numbers from 0 to 4
  j++;
}

Array and forEach Loop:

An array is a special variable that can store multiple values. JavaScript arrays are zero-indexed.

let fruits = ["apple", "banana", "orange"];
console.log(fruits[0]); // Outputs: apple

The forEach loop allows you to iterate through array elements.

fruits.forEach(function(fruit) {
  console.log(fruit);  // Outputs each fruit in the array
});

Defining and Invoking Functions:

Functions allow you to define reusable blocks of code.

// Function declaration
function greet(name) {
  console.log("Hello, " + name);
}

// Function invocation
greet("Alice");  // Output: Hello, Alice

Built-in Objects in JavaScript:

JavaScript provides various built-in objects like Date, Math, and String to perform specific tasks.

  • Date Object: Used to handle date and time.
let today = new Date();
console.log(today);  // Outputs current date and time
  • Math Object: Provides mathematical functions.
console.log(Math.random()); // Outputs a random number between 0 and 1
console.log(Math.max(1, 2, 3)); // Outputs 3

Date Objects in JavaScript:

The Date object is used to represent dates and times.

let currentDate = new Date();
console.log(currentDate.getFullYear());  // Outputs the current year

Interacting With the Browser:

JavaScript can interact with the browser using the window object and manipulate browser features.

// Alert box
window.alert("This is an alert");

// Prompt box to collect user input
let userInput = window.prompt("Enter your name:");
console.log(userInput);  // Outputs the name entered by the user

Windows and Frames in JavaScript:

JavaScript allows interaction with browser windows and frames.

// Opening a new window
let newWindow = window.open("https://www.example.com", "exampleWindow", "width=600,height=400");

Document Object Model (DOM):

The DOM represents the structure of an HTML document as an object. JavaScript interacts with this structure, allowing you to manipulate HTML and CSS dynamically.

document.getElementById("header").innerHTML = "New Header Text";  // Changes the content of an element with id 'header'

Event Handling in JavaScript:

JavaScript can handle events like clicks, keypresses, and mouse movements.

<button onclick="changeText()">Click me</button>

<script>
  function changeText() {
    document.getElementById("header").innerHTML = "Button Clicked!";
  }
</script>

Events can also be handled using Event Listeners:

document.getElementById("myButton").addEventListener("click", function() {
  alert("Button clicked!");
});

Forms and Client-Side Validations:

Forms are essential for collecting user input. JavaScript can validate form fields before submitting them.

<form id="myForm">
  <input type="text" id="name" placeholder="Enter your name" required>
  <input type="submit" value="Submit">
</form>

<script>
  document.getElementById("myForm").onsubmit = function() {
    let name = document.getElementById("name").value;
    if (name === "") {
      alert("Name is required!");
      return false;  // Prevent form submission
    }
  };
</script>

Cookies in JavaScript:

Cookies are small pieces of data stored on the client-side. JavaScript can create, read, and delete cookies.

// Create a cookie
document.cookie = "username=John Doe; expires=Fri, 31 Dec 2025 23:59:59 GMT";

// Read cookies

Read more

Numerical Method BCA fourth semester TU

Numerical Method Concepts Quiz



 Topic: Solution of Nonlinear Equations

Solution of Nonlinear Equations (10 Hours)

Nonlinear equations are equations that involve nonlinear terms, such as variables raised to a power other than one, trigonometric functions, exponential functions, and more. Solving these equations is fundamental in numerical methods, as they arise in many engineering, physics, and mathematical applications.


1. Introduction to Nonlinear Equations

  • A nonlinear equation is an equation of the form f(x)=0f(x) = 0, where f(x)f(x) is a nonlinear function.
  • Examples include:
    • x24=0x^2 – 4 = 0
    • sin(x)x2=0\sin(x) – x^2 = 0
  • These equations generally cannot be solved analytically and require numerical methods.

2. Types of Equations

  • Algebraic Equations: Polynomial equations, e.g., x36x+2=0x^3 – 6x + 2 = 0.
  • Transcendental Equations: Equations involving trigonometric, exponential, or logarithmic functions, e.g., ex3sin(x)=0e^x – 3\sin(x) = 0.

3. Errors in Computing

Errors arise due to approximations in numerical methods. Common types include:

  • Absolute Error: Ea=xtruexapproxE_a = |x_{\text{true}} – x_{\text{approx}}|
  • Relative Error: Er=xtruexapproxxtrueE_r = \frac{|x_{\text{true}} – x_{\text{approx}}|}{|x_{\text{true}}|}
  • Truncation Error: Errors due to approximating a mathematical process.

4. Numerical Methods for Solving Nonlinear Equations


4.1 The Bisection Method

  • Principle: The method divides an interval [a,b][a, b] into halves and repeatedly checks where the root lies. It requires f(a)f(b)<0f(a)f(b) < 0.
  • Formula: c=a+b2,Check: f(c) to find the new interval.c = \frac{a+b}{2}, \quad \text{Check: } f(c) \text{ to find the new interval.}
  • Advantages: Simple and reliable.
  • Disadvantages: Slow convergence.

Example: Solve f(x)=x34x9=0f(x) = x^3 – 4x – 9 = 0 using the Bisection Method on [2,3][2, 3].

  1. f(2)=5f(2) = -5, f(3)=6f(3) = 6, f(2)f(3)<0f(2)f(3) < 0.
  2. Midpoint: c=2+32=2.5c = \frac{2+3}{2} = 2.5, f(2.5)=1.875f(2.5) = -1.875.
  3. Update interval to [2.5,3][2.5, 3].
  4. Repeat until desired accuracy.

Practice Question: Solve x25=0x^2 – 5 = 0 on [2,3][2, 3] using the Bisection Method.


4.2 The Method of False Position (Regula Falsi)

  • Principle: Similar to the Bisection Method but uses a linear approximation between points.
  • Formula: c=af(a)(ba)f(b)f(a)c = a – \frac{f(a)(b-a)}{f(b)-f(a)}
  • Advantages: Faster than Bisection.
  • Disadvantages: Can stagnate.

Example: Solve f(x)=x3x1=0f(x) = x^3 – x – 1 = 0 on [1,2][1, 2].

  1. f(1)=1f(1) = -1, f(2)=5f(2) = 5, f(1)f(2)<0f(1)f(2) < 0.
  2. c=11(21)5(1)=1.1667c = 1 – \frac{-1(2-1)}{5-(-1)} = 1.1667.
  3. Update interval and repeat.

Practice Question: Solve x26=0x^2 – 6 = 0 on [2,3][2, 3] using the Method of False Position.


4.3 Newton-Raphson Method

  • Principle: Uses the tangent line at a point to approximate the root.
  • Formula: xn+1=xnf(xn)f(xn)x_{n+1} = x_n – \frac{f(x_n)}{f'(x_n)}
  • Advantages: Very fast convergence near the root.
  • Disadvantages: Requires derivative and may diverge.

Example: Solve f(x)=x22=0f(x) = x^2 – 2 = 0 with x0=1.5x_0 = 1.5.

  1. f(x)=x22f(x) = x^2 – 2, f(x)=2xf'(x) = 2x.
  2. x1=1.51.5222(1.5)=1.4167x_1 = 1.5 – \frac{1.5^2 – 2}{2(1.5)} = 1.4167.
  3. Repeat until desired accuracy.

Practice Question: Solve ln(x)+x2=0\ln(x) + x – 2 = 0 using Newton-Raphson with x0=1x_0 = 1.


4.4 Fixed-Point Iteration

  • Principle: Rewrites the equation as x=g(x)x = g(x) and iterates.
  • Formula: xn+1=g(xn)x_{n+1} = g(x_n)
  • Convergence Criterion: g(x)<1 near the root.|g'(x)| < 1 \text{ near the root.}

Example: Solve x3+x1=0x^3 + x – 1 = 0 by rewriting as x=1x3x = \sqrt[3]{1 – x}.

  1. g(x)=1x3g(x) = \sqrt[3]{1-x}, x0=0.5x_0 = 0.5.
  2. x1=10.53=0.7937x_1 = \sqrt[3]{1 – 0.5} = 0.7937.
  3. Repeat.

Practice Question: Solve x23=0x^2 – 3 = 0 by Fixed-Point Iteration.


4.5 Solution of a System of Nonlinear Equations

  • Uses extensions of methods like Newton-Raphson.
  • Example: Solve: f(x,y)=x2+y24=0,g(x,y)=x2y1=0f(x, y) = x^2 + y^2 – 4 = 0, \quad g(x, y) = x^2 – y – 1 = 0 using an iterative approach.

Summary

  • Bisection Method: Reliable, slower.
  • Method of False Position: Faster, may stagnate.
  • Newton-Raphson: Fast, requires derivative.
  • Fixed-Point Iteration: Simple, depends on g(x)<1g'(x) < 1.
  • System of Equations: Extension of Newton-Raphson.

Practice Problems

  1. Solve x35x+3=0x^3 – 5x + 3 = 0 using Newton-Raphson with x0=1x_0 = 1.
  2. Solve sin(x)x/2=0\sin(x) – x/2 = 0 on [1,2][1, 2] using the Method of False Position.
  3. Solve the system: x2+y2=5,xy=1x^2 + y^2 = 5, \quad x – y = 1 using a numerical method.

Read more

Operating System BCA fourth Semester TU Notes

 

View/Download


Past Question 2079 View

Tribhuvan University

Institute of Science and Technology

2079

Bachelor Level / fourth-semester / Science

Computer Science and Information Technology( CSC264 )

Operating System

Full Marks: 60 + 20 + 20

Pass Marks: 24 + 8 + 8

Time: 3 Hours

Candidates are required to give their answers in their own words as far as practicable.

The figures in the margin indicate full marks.

Section A

Long Answer Question

1Discuss about single level and two level directory system. Consider the following process and answer the following questions.

 

       Process

          Allocation

    Max

      Available

     A    B    C     D

    A    B    C    D

     A   B    C     D

       P0

     0    0     1      2

   0     0     1     2

     1    5      2     0

       P1

     1     0     0     0

   1      7      5     0

       P2

     1     3     5      4

   2      3     5      6

       P3

    0     6     3       2

   0      6     5       2

       P4

    0     0    1        4

    0    6      5       6

a. What is the content of matrix Need?

b.  Is the system in safe state?

c.  If P1 request (0,4,2,0) can the request be granted immediately.

2When does race condition occur in inter process communication? What does busy waiting mean and how it can be handled using sleep and wakeup strategy?

3Define shell and system call. suppose  a disk has 201 cylinders, numbered from 0 to 200. At  same time the disk arm is at cylinder 95, and there is a queue of disk access requests for cylinders 82,170,43,140,24,16 and 190. Calculate the seek time for the disk scheduling algorithm FCFS,SSTF,SCAN and C-SCAN.

Section B

Short Answer Questions

4Distinguish between starvation and deadlock . How does the system schedule process using multiple queues?

5List any two demerits of disabling interrupt to achieve mutual exclusion. Describe about fixed and variable partitioning

6For the following dataset, compute average waiting time for SRTN and SJF.

        Process

      Arrival Time

      Burst Time

     P0

      0

     7

     P1

      2

     4

     P2

      4

     1

     P3

     5

     4

7Discuss the advantages disadvantages of implementing file system using Linked List.

8Consider the page references 7,0,1,2,0,3,0,4,2,3,0,3,2, Find the number of page fault using OPR and  FIFO, with 4 page frame.

9Describe the working mechanism of DMA.

10What is the task of disk controller ? List some drawback of segmentation.

11Write the structure and advantages of TLB.

12Why do we need the concept of locality of reference ? List the advantages and disadvantages of Round Robin algorithm.

 

Read more