HISSAN - 2079 (2023) Solution: Computer Science -- Class 12

HISSAN CENTRAL EXAMINATION - 2079 (2023)

Grade: XII     Time: 2 hrs

Subject: Computer Science (TH) [4281 A]     Full Marks: 50

GROUP A [9×1=9]

Multiple Choice Questions: Choose the correct answer.

1. In which normal form of database transitive dependency should not occur?
A) First Normal Form
B) Second Normal Form
C) Third Normal Form ✔
D) All of the above
2. Which technique is used to grant privileges to user in a database?
A) Authentication
B) Authorization ✔
C) Isolation
D) Backup
3. Which SQL command displays records where FNAME starts with "H"?
A) SELECT * FROM STUDENT WHERE FNAME LIKE "H";
B) SELECT * FROM STUDENT WHERE FNAME LIKE "%H%";
C) SELECT * FROM STUDENT WHERE FNAME LIKE "H%"✔;
D) SELECT * FROM STUDENT WHERE FNAME LIKE "H";
4. Which of the following is a remote login service?
A) FTP
B) Telnet ✔
C) SMTP
D) All of the above
5. Which of the following is a server-side scripting language?
A) PHP ✔
B) MySQL
C) JavaScript
D) SQL
6. Which keywords are used to declare variables in JavaScript?
A) int or suppose
B) float or int
C) var or let ✔
D) char or var
7. What is the result of combining a string with another data type in PHP?
A) Float
B) int
C) String ✔
D) double
8. The process of hiding internal details and exposing functionality is:
A) Class
B) Polymorphism
C) Inheritance
D) Data Abstraction✔
9. Which of the following is not a phase of SDLC?
A) Analysis
B) Developing
C) Testing
D) Meeting✔
GROUP B [5×5=25]
10. Suppose you are appointed as an IT expert in a Hotel. What kind of database system would you prefer and why? [5]

Hotel Database System – 5 Marks Answer

If I were appointed as an IT expert in a hotel, I would prefer using a Relational Database Management System (RDBMS) for managing the hotel’s data. A Relational Database Management System (RDBMS) stores data in the form of tables (rows and columns) and maintains relationships between different tables using keys.

Reasons for Preferring RDBMS:

1. Structured Data Management:
A hotel deals with structured data such as guest details, room bookings, billing records, staff information, and inventory. RDBMS organizes this data systematically in tables.
2. Data Integrity and Accuracy:
RDBMS uses primary keys and foreign keys to maintain relationships and prevent duplication of records. This ensures accurate booking and billing information.
3. Multi-user Access:
Different departments like reception, accounts, housekeeping, and management can access the database simultaneously without data conflict.
4. Security and Access Control:
RDBMS provides authentication and authorization features. Sensitive information such as customer details and financial records can be protected using user roles and passwords.
5. Easy Query and Report Generation:
Using SQL, the hotel management can easily generate reports such as available rooms, daily income, customer history, and occupancy rate.
Conclusion:
Therefore, RDBMS is the most suitable database system for a hotel because it provides structured storage, security, reliability, and efficient data management.
11. Write a program in JavaScript to add two variables. [5]
<script>
let a = 10;
let b = 20;
let sum = a + b;
console.log("Sum = " + sum);
</script>
12. Differentiate between OOP and Procedural Oriented Language. [5]

Difference Between Object-Oriented and Procedural Programming – 5 Marks

Programming can be broadly categorized into Procedural Programming (POP) and Object-Oriented Programming (OOP). Both have different approaches to problem-solving.

Key Differences:

1. Approach:
POP focuses on functions or procedures to perform tasks, while OOP focuses on objects and data which combine data and functions.
2. Data Handling:
In POP, data flows freely between functions, whereas in OOP, data is encapsulated within objects and protected from outside access.
3. Program Structure:
POP follows a top-down approach, starting from main program to functions. OOP follows a bottom-up approach, starting from objects and building the system.
4. Reusability:
In POP, code reuse is limited to functions. In OOP, inheritance and polymorphism allow high reusability of objects and methods.
5. Real-world Modelling:
POP is suitable for small programs, whereas OOP models real-world entities efficiently using objects, making it ideal for complex applications.
Conclusion:
Object-Oriented Programming is more organized, secure, and scalable compared to Procedural Programming, making it suitable for modern software development.
13. State various stages of SDLC and explain any two. [5]

Software Development Life Cycle (SDLC) – 5 Marks

The Software Development Life Cycle (SDLC) is a systematic process followed to develop high-quality software. It consists of several stages to ensure proper planning, development, and maintenance.

Stages of SDLC:

  1. Requirement Gathering / Planning: Understanding the needs of the client and planning the project.
  2. Requirement Analysis: Analyzing requirements in detail to create a requirement specification document.
  3. System Design: Designing architecture, modules, interfaces, and database of the software.
  4. Development / Coding: Actual programming of the software using appropriate languages.
  5. Testing: Verifying that the software works as intended and fixing bugs.
  6. Implementation / Deployment: Installing and running the software in the client environment.
  7. Maintenance: Updating, enhancing, and fixing issues in the software after deployment.

Explanation of Any Two Stages:

1. Requirement Analysis:
In this stage, the project team gathers detailed information from clients and stakeholders to understand what the software must achieve. A Requirement Specification Document (RSD) is prepared, which guides all subsequent stages.
2. Development / Coding:
During this stage, developers write the actual program code according to the design documents. The system starts taking shape as a working software product, implementing the functionality defined in the previous stages.
Conclusion:
Following the SDLC stages ensures systematic development, reduces errors, and helps deliver reliable, maintainable, and high-quality software.
14. Explain mobile computing with advantages. [5]

Mobile Computing – 5 Marks

Mobile Computing refers to the ability to use computing devices such as smartphones, tablets, and laptops wirelessly and on-the-go. It allows users to access data, applications, and services without being tied to a fixed location.Mobile computing enables users to transmit data, voice, and video via portable, wireless-enabled devices without being tethered to a fixed location. It combines mobile communication (networks), hardware (devices), and software to provide flexible, on-the-go access to information, transforming productivity and communication.

Advantages of Mobile Computing:

1. Increased Flexibility:
Users can access applications, data, and services from anywhere, enabling remote work and on-the-go management of tasks.
2. Real-time Communication:
Mobile computing allows instant communication through emails, messaging apps, and video calls, which is crucial for quick decision-making and collaboration.
3. Improved Productivity:
Professionals can perform tasks and access information quickly while traveling or outside the office, enhancing overall productivity.
4. Cost Efficiency:
Reduces the need for physical office setups and infrastructure, lowering operational costs for businesses.
GROUP C [2×8=16]
15. Suppose you are appointed as IT expert of a bank. Which network architecture would you prefer and why? [8]

Preferred Network Architecture for a Bank – 8 Marks

If I were appointed as an IT expert for a bank, I would prefer the Client-Server Architecture for the bank's network. This architecture is widely used in banks due to its security, scalability, and efficient management.

Reasons for Preferring Client-Server Architecture:

1. Centralized Management:
Client-Server architecture allows centralized control over all data and applications. Critical data like transaction records and account details are stored on secure, centralized servers, making it easier to manage and backup efficiently.
2. Data Security:
Banks handle sensitive financial data. Data access can be strictly controlled and monitored. Security protocols like firewalls, encryption, and access control mechanisms are implemented at the server level to ensure safe transmission and storage.
3. Scalability:
Client-Server architecture supports easy scalability. As the bank grows, more servers can be added or server capacity upgraded without disrupting services.
4. Reliable Communication and Data Flow:
Client devices (e.g., ATMs, desktop terminals) securely interact with the central server, ensuring fast and reliable data processing. Customer requests at ATMs or terminals are efficiently processed by the server.
5. High Availability and Redundancy:
Multiple servers and redundant systems ensure high availability. Backup servers handle failures to ensure uninterrupted banking services.
6. Easy Maintenance and Updates:
Updates and maintenance are simpler because the server is centralized. Security patches, software updates, and new features are deployed on the server and reflected automatically on all client devices.
16. Write a C program using structure to store and display marks of 10 students. [8]
[Note: You don't need to write comment in your exam so don't copy comment    (comment starts from // )


#include<stdio.h>  // Standard input-output library for printf and scanf


struct Student {           // Define a structure to store student information
    int roll;             // Roll number of the student
    char name[50];        // Name of the student (up to 49 characters + null terminator)
    int english;          // Marks in English
    int computer;         // Marks in Computer
    int maths;            // Marks in Maths
    int nepali;           // Marks in Nepali
    int total;            // Total marks (sum of all subjects)
};


int main() {
    struct Student s[10];  // Declare an array of 10 students directly

   
    for(int i = 0; i < 10; i++) {              // Loop through each student to input their data
        printf("Roll: ");                // Ask for roll number
        scanf("%d", &s[i].roll);        // Store roll number in the structure

        printf("Name: ");                // Ask for student name
        scanf(" %[^\n]", s[i].name);    // Store full name (including spaces)

        printf("English: ");             // Ask for English marks
        scanf("%d", &s[i].english);     

        printf("Computer: ");            // Ask for Computer marks
        scanf("%d", &s[i].computer);    

        printf("Maths: ");               // Ask for Maths marks
        scanf("%d", &s[i].maths);       

        printf("Nepali: ");              // Ask for Nepali marks
        scanf("%d", &s[i].nepali);      

        
        s[i].total = s[i].english + s[i].computer + s[i].maths + s[i].nepali;             // Calculate total marks
    }

    // Optional: Print table of students 
    // Print table header
    printf("\nRoll\tName\t\tEnglish\tComputer\tMaths\tNepali\tTotal\n");
    printf("---------------------------------------------------------------\n");
    for(int i = 0; i < 10; i++) {
        printf("%d\t%s\t\t%d\t%d\t%d\t%d\t%d\n",
               s[i].roll, s[i].name, s[i].english, s[i].computer, s[i].maths, s[i].nepali, s[i].total);   // /t gives 1 tab(space)
    }

    return 0;  // End of program
}



OR
Write a program in C to create and store name, gender, and phoneno of students to a data file named "ADDRESS.DAT". The program should prompt the user whether to continue or not. The program should also display all the records in the proper format. [8]
#include <stdio.h>

int main()
{
    char name[100];
    char gender[20];
    int phone_no;
    char choice='y';
    FILE *p;
    p = fopen("ADDRESS.DAT", "w+");

    while(choice != 'n')
    {
        printf("enter name\n");
        scanf("%s", name);

        printf("enter gender\n");
        scanf("%s", gender);

        printf("enter phone number\n");
        scanf("%d", &phone_no);

        fprintf(p, "%s\t%s\t%d\n", name, gender, phone_no);

        printf("enter y to continue and n to discontinue\n");
        fflush(stdin);
        scanf(" %c", &choice);
    }

    rewind(p);
    while((fscanf(p, "%s %s %d", name, gender, &phone_no)) != EOF)
    {
        printf("name = %s\n", name);
        printf("gender = %s\n", gender);
        printf("phone number = %d\n", phone_no);
        printf("-----------------------\n");
    }

    fclose(p);
    return 0;
}

Written By

Helping Students Succeed • •Free Book Solutions and Study Guides • sandesh_Shiwakoti