Friday, April 11, 2025

[SOLUTION] SET M1 HISSAN CENTRAL EXAMINATION-2081 (2025)


HISSAN CENTRAL EXAMINATION - 2081 (2025)

Grade: XII

COMPUTER SCIENCE (4281 M1)

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

GROUP A

Multiple Choice Questions.                                                                     [9 × 1 = 9]

  1. Which database language is used for defining schema structures?
    a) DML
    b) DDL
    c) DCL
    d) TCL

Note: DDL (Data Definition Language) is used to define the structure of the database, like creating tables, altering structures, and deleting them. Commands: CREATE, ALTER, DROP.

  1. Which of the following operations are used to extract data from a database?
    a) SELECT
    b) DELETE
    c) UPDATE
    d) INSERT

Note: SELECT is used to fetch data from a table.
Other options:  DELETE: removes records, UPDATE: modifies data, INSERT: adds new records

  1. Which of the following is NOT a valid PHP data type?
    a) String
    b) Float
    c) Character
    d) Boolean

Note: PHP uses strings to represent characters; there's no separate char type like in C or Java.
Valid types: String, Integer, Float, Boolean, Array, Object, etc.

  1. Which symbol is used for single-line comments in JavaScript?
    a) //
    b) /* */
    c) <!-- -->
    d) **

Note: // is used for single-line comments, while /* */ is for multi-line.

  1. What is the default return type of a function in C if no return type is specified?
    a) void
    b) int
    c) char
    d) float

Note: In older C standards (like K&R), if no return type is mentioned, int is assumed by default. It's best practice now to explicitly declare return types.

  1. Which network device is used to connect multiple networks together?
    a) Hub
    b) Switch
    c) Router
    d) Repeater

Note: A router connects different networks and directs data between them.

Hub: connects devices in a LAN, Switch: smarter hub for LAN, Repeater: boosts signals

  1. What is cloud computing?
    a) A type of software
    b) A type of hardware
    c) The delivery of computing services over the internet
    d) A programming language

Note: It includes services like storage, databases, servers, networking, and software, hosted remotely and accessed via the internet.

  1. Which of the following is NOT a principle of OOP?
    a) Encapsulation
    b) Inheritance
    c) Compilation
    d) Polymorphism

Note: Main principles of Object-Oriented Programming are: Encapsulation, Inheritance, Polymorphism
Compilation is a general programming concept, not specific to OOP.

  1. Which of the following SDLC models is also known as the "linear-sequential model"?
    a) Spiral Model
    b) Waterfall Model
    c) Agile Model
    d) V-Model

Note: Waterfall is a linear approach where each phase (Requirement, Design, Implementation, etc.) must be completed before the next begins. It’s simple but rigid.

 

GROUP B

Short Answer Questions:                                                                  [5 × 5=25]

  1. What is database? Explain any three advantages of DBMS. [2+3]
    OR
    Explain second normal form with example. [5]
  2. Write a JavaScript function that takes two numbers as arguments and returns their sum. [5]
    OR
    Write a PHP script to find the largest of three numbers. [5]

Ans:

<!DOCTYPE html>

<html>

<head>

    <title>Largest Among Three Numbers</title>

</head>

<body>

<form method="post">

  Enter First Number: <input type="number" name="a" required>

  Enter Second Number: <input type="number" name="b" required>

  Enter Third Number: <input type="number" name="c" required>

  <input type="submit" name="largest" value="Find Largest">

</form>

<?php

if(isset($_POST['largest']))

{

    $a = $_POST['a'];

    $b = $_POST['b'];

    $c = $_POST['c'];

    if ($a > $b && $a > $c)

    {

        echo "The largest number is:" . $a;

    }

    elseif ($b > $c && $b>$a)

    {

        echo "The largest number is:" . $b;

    }

    else

    {

        echo "The largest number is:" . $c;

    }

}

?>

</body>

</html>

 

  1. Explain the concept of inheritance in OOP. How does inheritance help in code reusability? [2+3]

Ans:

In Object-Oriented Programming (OOP), inheritance is a fundamental concept that allows a class (called a subclass or derived class) to inherit properties and behaviours (methods and attributes) from another class (called a superclass or base class).

For example:

Superclass = Animal (base class)

Subclass = Mammal, Bird, Fish (derived classes)

Inheritance = Mammals, Birds, and Fish inherit common features (like eat()) from the Animal class, but they also add their own specific features (like nurse() for Mammals, fly() for Birds, swim() for Fish).

 

Inheritance promotes code reusability by allowing a child class to use (or inherit) the methods and properties of a parent class without rewriting the same code.

Here’s how inheritance help in code reusability:

a.       Avoids Code Duplication: Common features are written once in the parent class and reused in all child classes. Example: A Vehicle class has a method move(). All vehicles like Car, Bike, Bus can reuse move() without writing it again.

b.       Centralized Maintenance: If there’s a bug or a need for an update, changing it in the parent class updates it for all child classes automatically.

c.       Scalability and Easy Extension: New classes can be created by inheriting existing ones and only adding new, specific features. Example: You can create a new ElectricCar class that inherits from Car and just adds a chargeBattery() method.

 

  1. What is e-learning? Write any three advantages of e-learning. [2+3]

Ans:

E-Learning refers to the use of electronic media, such as the internet, computers, and digital platforms, to deliver educational content and facilitate learning. It enables students to access courses, training, and resources remotely, without the need for traditional classroom settings.

Types of E-Learning:

1. Synchronous: Real-time classes with instructors and students interacting (e.g., live webinars).

2. Asynchronous: Pre-recorded lessons and materials that learners can access at any time (e.g., MOOCs, video tutorials).

3. Blended Learning: Combines online learning with traditional face-to-face education. 

Advantages of E-Learning:

a)       Flexibility to learn anytime, anywhere. Example: A working professional, can take online courses whenever it fits her schedule, whether day or night.

b)      Cost-effective, as it reduces the need for physical infrastructure. Example: A company saves money by offering online employee training instead of organizing physical classes with travel and room costs.

c)       Access to a wide variety of resources and expert instructors. Example: A person can take an online graphic design course with top instructors from Skillshare, using video tutorials and project files.

 

  1. What is the purpose of the requirements gathering phase in the SDLC? Explain. [5]

Ans:

The requirements gathering phase in the Software Development Life Cycle (SDLC) is crucial because it lays the foundation for the entire project.

The main purpose is to understand what the users or clients need from the software. During this phase, developers, business analysts, and stakeholders collaborate to collect and document all the functional and non-functional requirements of the system.

            Some key Objectives or purposes of the requirements gathering phase in the SDLC are as                        follows:

1.       Identify Stakeholders’ Needs:

Ø  Understand what the users expect the software to do.

Ø  Get input from all relevant parties (clients, users, managers, etc.).

2.       Define System Requirements Clearly:

Ø  Document exactly what features and functions are required.

Ø  Avoid misunderstandings and assumptions later in development.

3.       Establish Project Scope:

Ø  Decide what the software will include and what it won't.

Ø  Helps in planning time, cost, and resources accurately.

4.       Serve as a Reference:

Ø  Acts as a base for designing, developing, testing, and deploying the system.

Ø  Prevents scope creep (adding new features mid-project without proper evaluation).

In Conclusion:

The requirements gathering phase ensures that the right product is built, and built right according to what users actually need. Missing or misunderstood requirements at this stage can lead to project delays, cost overruns, or a failed system.

 

GROUP C

Long Answer Questions:                                                                                        [2 × 8=16]

  1. What is a computer network? Explain any three types of network topologies with their advantages. [2+6]
  2. Write a C program to read and display employee details using a structure.
    Define a structure Employee to store employee name (string), ID (integer), and salary (float). Write a program to input values for these fields and then display them. [2+6]

Ans:

#include <stdio.h>

#include <conio.h>

struct Employee

{

    char name[50];

    int id;

    float salary;

};

void main()

{

    struct Employee emp[100];

    int n, i;

    clrscr();

    printf("Enter number of employees: ");

    scanf("%d", &n);

    for (i = 0; i < n; i++)

    {

        printf("\nEnter details for Employee %d:\n", i + 1);

        printf("Enter Name: ");

        scanf("%s", emp[i].name);  

        printf("Enter ID: ");

        scanf("%d", &emp[i].id);  

        printf("Enter Salary: ");

        scanf("%f", &emp[i].salary);

    }

    printf("\nEmployee Details:\n");

    printf("ID\tNAME\tSALARY\n");

    for (i = 0; i < n; i++)

    {

        printf("%d\t%s\t%.2f\n", emp[i].id, emp[i].name, emp[i].salary);

    }

    getch();

}

Example Output:

Enter number of employees: 2

 

Enter details for Employee 1:

Enter Name: Alice

Enter ID: 101

Enter Salary: 50000

 

Enter details for Employee 2:

Enter Name: Bob

Enter ID: 102

Enter Salary: 60000

 

Employee Details:

ID       NAME       SALARY

101    Madhav    50000.00

102    Subash      60000.00

 

OR

What is a pointer? Write a C program to add two numbers using call by reference.  [2+6]

Ans:

#include <stdio.h>

#include <conio.h>

void add(int *a, int *b, int *sum);           // Function declaration

void main()

{

    int a, b, result;

    clrscr();

    printf("Enter 1st number: ");

    scanf("%d", &a);

    printf("Enter 2nd number: ");

    scanf("%d", &b);

    add(&a, &b, &result);                // Call by reference

    printf("\nSum of the two numbers: %d", result);

    getch();

}

void add(int *a, int *b, int *sum)              // Function definition

{

    *sum = *a + *b;

}

Example Output:

Enter 1st number: 12

Enter 2nd number: 8

Sum of the two numbers: 20

 

 

THE END

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home