Class 12 Web Applications 803 Previous Year Question Paper 2022 – Term 2 – Solution

Series %BAB%
Question Paper Code 327 Set 4

WEB APPLICATIONS – SOLUTION
(Session 2021-22)

Time allowed : 1:30 hours
Maximum Marks : 30

General Instructions :

  1. Please read the instructions carefully.
  2. This question paper is divided into 3 sections, viz., Section A, Section B and Section C.
  3. Section A is of 5 marks and has 6 questions on Employability Skills.
    (a) Question numbers 1 to 4 are one mark questions. Attempt any three questions.
    (b) Question numbers 5 and 6 are two marks questions. Attempt any one question.
  4. Section B is of 17 marks and has 16 questions on Subject Specific Skills.
    (a) Question numbers 7 to 13 are one mark questions. Attempt any five questions.
    (b) Question numbers 14 to 18 are two marks questions. Attempt any three questions.
    (c) Question numbers 19 to 22 are three marks questions. Attempt any two questions.
  5. Section C is of 8 marks and has 3 Competency-Based Questions.
    (a) Question numbers 23 to 25 are four marks questions. Attempt any two questions.
  6. Do as per the instructions given in the respective sections.
  7. Marks allotted are mentioned against each section/question.

SECTION A (Employability Skills) (3+2=5 marks)

Answer any 3 questions out of the given 4 questions. (3X1=3)

1. Explain the term Startup w.r.t. entrepreneurship.
Answer: A startup, in the context of entrepreneurship, is a relatively new and small business venture that is founded by one or more individuals or entrepreneurs with the goal of developing and bringing to market a unique product, service, or technology.

2. ____ is the ability to continue to do something, even when it is difficult.
Answer: Resilience

3. Identify green workers from the following :
A truck driver of diesel fuel truck, An electrician who installs solar panel, A worker working in a plastic factory.

Answer: An electrician who installs solar panel

4. A ____ worker is one who is employed in the environmental sectors of the economy.
Answer: environmental worker

Answer any 1 question out of the given 2 questions. (1X2=2)

5. Explain any two attitudes of an entrepreneur.
Answer: Long-term Vision: They think beyond immediate gains and are committed to building sustainable enterprises that can thrive over the long haul.
Passion and Dedication: Entrepreneurs are often deeply passionate about their ideas and businesses. They are driven by a strong belief in what they are doing.

6. Write any two measures we can take to protect our environment.
Answer: (i) Conserve Energy: Use energy-efficient appliances and lighting.
(ii) Reduce Single-Use Plastics: Minimize the use of single-use plastic products like bags, bottles, and straws.

SECTION B (Subject Specific Skills) (5+6+6=17 marks)

Answer any 5 questions out of the given 7 questions. (5X1=5)

7. Write the output of the following code :
Nan + 5

Answer: { "result": "NaN" }
In this JSON representation, the result of the expression “Nan + 5” is NaN.

8. Write a statement in JavaScript to declare a variable ‘Sum’ and initialize it with 10.
Answer: var Sum = 10;

9. How many times will the following loop run ?
for (var i = 0; i < = 5; i ++)
{
……
}

Answer: It runs for i values 0, 1, 2, 3, 4, and 5, which is a total of six iterations.

10. Write the examples of any two logical operators you know.
Answer: (i) AND Operator (&&), (ii) OR Operator (||)

11. What is IntelliSense ?
Answer: IntelliSense is a feature found in integrated development environments (IDEs) and code editors that provides context-aware code suggestions, autocompletion, and documentation as developers write code. It is designed to enhance the coding experience by helping developers write code more efficiently and with fewer errors.

12. Expand the term IIS.
Answer: Internet Information Services

13. Information collected through web based forms can be stored in a ____ with appropriate fields for every entry in the form.
Answer: database

Answer any 3 questions out of the given 5 questions. (3X2=6)

14. Write any two ways to convert a string to number in JavaScript.
Answer: In JavaScript, you can convert a string to a number using the following two common methods:
(i) Using parseInt() or parseFloat(): parseInt(string) converts a string to an integer, parsing it until a non-numeric character is encountered.
(ii) Using the Number() constructor: JavaScript provides the Number() constructor that can be used to explicitly convert a string to a number. It can handle both integers and floating-point numbers.

15. Write a command to declare an array ‘AR’. Explain any one property of an array.
Answer: To declare an array named ‘AR’ in JavaScript, you can use the following command: var AR = [];
One important property of an array in JavaScript is its length property. The length property indicates the number of elements in the array.
Example:
var AR = [10, 20, 30, 40, 50];
console.log(AR.length);

// Outputs: 5

16. What do you understand by properties and methods of an object ?
Answer: In object-oriented programming, objects are the fundamental building blocks used to model real-world entities or abstract concepts in code. Objects can have two main components: properties and methods.
Properties: Properties of an object represent the characteristics or attributes of that object. They are variables that store data associated with the object. These data values can be of various types, such as numbers, strings, booleans, or other objects. For example, if you have an object representing a “car,” its properties might include “color,” “model,” “year,” and “fuelType” etc.
Methods: Methods of an object are functions that are associated with that object. They define the behaviors or actions that the object can perform. Methods can manipulate the object’s properties, perform calculations, or interact with other objects. For example, an object representing a “calculator” might have methods like “add,” “subtract,” “multiply,” and “divide.

17. Write any two points about Snippets.
Answer: Snippets are commonly used in software development to facilitate code reuse, improve productivity, and maintain coding standards. Here are two points about snippets:
(i) Code Reusability: Snippets are pre-defined pieces of code or templates that can be easily inserted into your codebase. They enable code reusability, helping developers avoid rewriting the same code segments multiple times. This is particularly useful for commonly used functions, classes, or code patterns.
(ii) Productivity Enhancement: Snippets significantly improve developer productivity. Instead of manually typing out lengthy or complex code structures, developers can simply insert a snippet, saving time and reducing the chance of typographical errors.

18. What do you mean by structure of a website ? Explain any one use of it.
Answer: The structure of a website refers to the layout of its content, including how different elements and pages are arranged and interconnected. A well-structured website is essential for providing a logical and user-friendly experience to visitors.
One important aspect of a website’s structure is the use of a navigation menu or navigation bar.
Navigation Menu: A navigation menu is a user interface element that typically appears on a website, often at the top or side, and provides a list of links to various pages or sections of the site. It serves as a road map for visitors to easily navigate and access different parts of the website.

Answer any 2 questions out of the given 4 questions. (2X3=6)

19. Write a function in JavaScript that accepts two integer variables and returns their sum.

function addTwoNumbers(a, b) {
    if (Number.isInteger(a) && Number.isInteger(b)) {
        return a + b;
    } else {
        return "Both inputs must be integers.";
    }
}

// Example usage:
var num1 = 5;
var num2 = 7;
var result = addTwoNumbers(num1, num2);
console.log("The sum is: " + result); // Outputs: The sum is: 12

20. Explain the term inner function in JavaScript with an example.
Answer: In JavaScript, an inner function is a function defined within another function. Inner functions have access to the variables and scope of the outer function, which allows for more controlled and modular code. These inner functions are also known as nested functions or closures.

function outerFunction(outerParam) {
  // This is the outer function.
  
  // Variables defined in the outer function are accessible here.
  var outerVariable = 10;

  function innerFunction(innerParam) {
    // This is the inner function.
    
    // Variables from both the outer and inner scopes can be accessed here.
    var result = outerVariable + innerParam + outerParam;
    return result;
  }

  // Call the inner function from within the outer function.
  var innerResult = innerFunction(5);
  
  return innerResult;
}

// Call the outer function.
var finalResult = outerFunction(15);
console.log(finalResult); // Outputs: 30

21. Explain the use of reverse method in JavaScript. Write a function 'Revrs' in JavaScript to explain reverse the order of elements in a given array.
Answer: The reverse() method in JavaScript is used to reverse the order of elements in an array. It modifies the original array in place, meaning it changes the order of elements without creating a new array. The first element becomes the last, the second element becomes the second-to-last, and so on.
Here’s an example of how the reverse() method works:

var originalArray = [1, 2, 3, 4, 5];
originalArray.reverse();

console.log(originalArray); // Outputs: [5, 4, 3, 2, 1]

22. Rakshit has created a website and his friend has suggested to him to go for a free hosting server as Rahul is still learning to create a website.
Give the requirement to host a website with one’s own server.
Web hosting providers allow other methods which you can use to upload website. Name any one of the methods.

Answer: To host a website using your own server, you will need the following requirements: Adequate hardware, web server, reliable high-speed internet connection, domain name, Static IP Address, DNS configuration, Your website’s content etc.
Regarding methods for uploading a website to a hosting server, besides hosting on your own server, you can consider using FTP (File Transfer Protocol) to upload your website to a remote web server. FTP is a common method for transferring files to a web server, and many web hosting providers offer FTP access to upload and manage website files on their servers.

SECTION C (Competency-Based Questions) (2X4=8 marks)

Answer any 2 questions out of the given 3 questions. (2X4=8)

23. Write a program in JavaScript that accepts three numbers from the user and displays the average value.

<!DOCTYPE html>
<html>
<head>
    <title>Calculate Average</title>
</head>
<body>
    <script>
        // Prompt the user to enter three numbers
        var num1 = parseFloat(prompt("Enter the first number:"));
        var num2 = parseFloat(prompt("Enter the second number:"));
        var num3 = parseFloat(prompt("Enter the third number:"));

        // Check if the inputs are valid numbers
        if (isNaN(num1) || isNaN(num2) || isNaN(num3)) {
            alert("Please enter valid numbers.");
        } else {
            // Calculate the average
            var average = (num1 + num2 + num3) / 3;

            // Display the result
            document.write("The average of " + num1 + ", " + num2 + ", and " + num3 + " is: " + average);
        }
    </script>
</body>
</html>

24. Predict the output of the following :
<html>
<body>
<script>
var str="Honesty is the best policy";
document.write(str.match("policy")+"<br>");
document.write(str.match("Police")+"<br>");
document.write(str.match("pollicy")+"<br>");
document.write(str.match("policy")+"<br>");
</script>
</body>
</html>

Answer: The output will be as mentioned above, with “policy” appearing twice, and “null” appearing for the strings “Police” and “pollicy” as they are not found in the original string. Output is:
policy
null
null
policy

25. Kretika is learning to create a multimedia website. Give answers of the following to help her to gain knowledge before designing and developing the website :
(i) Give any one Internet browser that supports multimedia.

Answer: One popular internet browser that supports multimedia is Google Chrome.
(ii) What are raster graphics ? Give an example.

Answer: Raster graphics, also known as bitmap images, are a type of graphic that consists of a grid of individual pixels, each with its own color information. These graphics are resolution-dependent, and when you zoom in on a raster image, you may notice a loss of quality and pixelation. Common file formats for raster graphics include JPEG, PNG, and GIF.
(iii) Identify the type of file from the following :
.au, .mpg

Answer: .au is a file format commonly associated with audio files. It is often used for storing audio clips and is known as the “AU” format, which stands for “Audio.”
.mpg is a file format associated with video files. It is part of the MPEG (Moving Picture Experts Group) family of video compression formats. .mpg files typically contain compressed video and audio data and are used for storing movies, video clips, and other multimedia content.

Find Class 12 Web Applications Previous Year Question Papers

Find Class 12 Web Applications Previous Year Question Papers Solution

Find Class 12 Web Applications Previous Year Compartment Question Papers

Find Class 12 Web Applications Previous Year Compartment Question Papers Solution

Leave a Comment