NEB Class 12 Computer Science Model Question Solution

 Group A: Multiple Choice questions (9 x 1=9)

Tick the correct answer.

1. Which of the statements are used in DDL?

A) Create, alter and drop

B) Create, insert and select

C) Insert, update and delete

D) Delete, alter and drop

2. With SQL, how do you select all the records from a table named “Person” where the value of the column "FirstName" ends with an "a"?


A) SELECT * FROM Persons WHERE FirstName = ‘a’

B) SELECT * FROM Persons WHERE FirstName LIKE ‘a%’

C) SELECT * FROM Persons WHERE FirstName LIKE ‘%a’

D) SELECT * FROM Persons WHERE FirstName='%a%'

3. Which of the following statement, is true about a star network topology?

A) Each device is connected to a switch or hub

B) Each device is connected to each other

C) Each device is connected in a trunk

D) Each device connected to a terminal

4. Which of the following is the correct syntax to display "Stay Safe" in an alert box using JavaScript.

A) alert-box("Stay Safe");

B) confirm("Stay Safe");

C) msgbox("Stay safe"); '''

D) alert("Stay Safe");

5.What is the use of <A> tag? 

A) To insert an image

B) To create a link

C) To create a hyperlink

D) To create a list

 

6. What is the output of given C program?

void main(){

char str1[] = "FIRST"; char str2[20]; strcpy(str2,str1);

printf("%s %s ",str1,str2); printf("%d", (str1!=str2));

printf("%d", strcmp(str1,str2)); }  

 

A) FIRST FIRST 0 0

B) FIRST FIRST 1 1

C) FIRST FIRST 1 0

D) FIRST FIRST 0 1

7. Where is a class derived in inheritance?

A) Superclass

B) Subclass

C) Subset class

D) Relative Class

8. Which of these is the correct order of the SDLC?

A) Analysis, Design, Coding, Testing, Implementation

B) Analysis, Design, Testing, Implementation, Coding

C) Implementation, Coding, Analysis, Design, Testing

D) Design, Testing, Implementation, Coding, Analysis

9. Why is cloud computing popular nowadays?

A) Cost-sharing and easily accessible

B) As modem technology and costly

C) Accessible and freely available

D) Affordable to all

 

Group B Short Question (5*5=25)

1.       Explain 2NF and 3NF?

Ans:

The essence of normalization is to split your data into several tales that will be connected to each other based on the data within them.

i.                    Second normal form (2NF):

The table is in second normal form if every non-key column depends on the entire key. For these split the table. Pull out the columns that depend on parts of key. Remember to include that part of key in new table. The new table must have key or id that must be on both tables. Each attribute in the table must depend on whole key. For The Construction of 2NF we need to build 1 NF table. If we consider a 1NF table like this:

Name

Class

Roll no.

Section

Subjects

Marks

Ram

12

2

A

Maths

90

Shyam

11

1

B

English

90

Hari

12

1

A

Computer

90

Ram

12

2

A

English

78

Fig. 1NF Table

Table 1: Students

Table 2: Subjects

Table 3: Marks of Students

Name

Roll No.

Class

Section

Subjects

Class

Name

Subjects

Marks

Ram

2

12

A

English

11

Ram

Maths

90

Shyam

1

11

B

English

12

Shyam

English

90

Hari

1

12

A

Computer

12

Hari

Computer

90

 

 

 

 

Maths

12

Ram

English

78

Fig. 2NF Table (cell with different color shows different table)

In the above whole table is split into the three tables marks, subject and student. The interrelated data are place together in the table. Name depends on roll+class+sec, subject name dependent on class not on roll. Name, subject and marks are interrelated.

ii.                    Third normal form (3NF)

 The logical, analysis and elements of designing for third normal form are similar to those used in deriving 2NF.In particular, you still concentrate on the issue of dependence. To be in 3NF a table must be in 2NF, and every non-key column must depend on nothing but the key.

Table1: Class

Table 2: Subjects

Table 3: Students

Table 4: Marks

Classid

Classname

Subjected

Subject

Stid

Name

Roll No.

Class

Section

stid

subjectid

marks

1

11

1

English

1

Ram

2

12

A

1

1

78

2

12

2

Computer

2

Shyam

1

11

B

1

3

90

 

 

3

Maths

3

Hari

1

12

A

2

1

90

 

 

 

 

 

 

 

 

 

3

2

90

Fig. 3NF Table (cell with different color shows different table)

In the given table all the attributes are depends on the key thus in the table class subject and student all the attributes depend on primary key but in table marks the data are dependent on stdid and subid. So, these four tables are the normalized data of the given non-normalized tables.

                                                OR

Demonstrate basic DML statement with an example.

Data Manipulation Language (DML):

 A data manipulation language (DML) is a family of computer languages including commands permitting users to manipulate data in a database. This manipulation involves inserting data into database tables, retrieving existing data, deleting data from existing tables and modifying existing data. DML is mostly incorporated in SQL databases. DML resembles simple English language and enhances efficient user interaction with the system. The functional capability of DML is organized in manipulation commands like SELECT, UPDATE, INSERT INTO and DELETE FROM, as described below:

SELECT: This command is used to retrieve rows from a table.

UPDATE: This command modifies data of one or more records.

INSERT: This command adds one or more records to a database table.

DELETE: This command removes one or more records from a table according to specified condition.

Example:

INSERT into student

VALUES (22, “Ram”);

 

2.       Write a function to add any two numbers in JavaScript.

Ans:

<!doctype html>

<html>

<head>

<script>

function add(){

var a,b,c;

a=Number(document.getElementById("first").value);

b=Number(document.getElementById("second").value);

c= a + b;

document.getElementById("answer").value= c;

}

</script>

</head>

<body>

Enter the First number : <input id="first">

Enter the Second number: <input id="second">

<button onclick="add()">Add</button>

<input id="answer">

</body>

</html>  

 

OR

Demonstrate the external CSS implemented in Web Page.

Ans:

The external style sheet is generally used when you want to make changes on multiple pages. It is ideal for this condition because it facilitates you to change the look of the entire web site by changing just one file.

The link to an external style sheet is placed within the head section of the page.

<head>

<link rel="stylesheet" type="text/css" href="mystyle.css">

</head> 

The actual style sheet file will contain CSS rules that are then applied across the entire page. For example:

body {

background-color: ghostwhite;

}

h1 {

color: blue; font-size: 20px; font-family: verdana; font-style:italic;

}   

In this case, the background color of the webpage will be ghostwhite and any h1 headings will appear in verdana font, as size twenty blue text in italic style.

 

3.       Describe any five features of OOP.

Ans:

Object oriented programming is a programming paradigm that was developed to overcome the drawbacks and limitations of particularly procedure-oriented programming. The major need for developing such languages was to manage the ever-increasing size and complexity of programs.

Features of OOP are:

Object: An object is any entity, thing or organization that exits in real world. It consists of two fundamentals characteristics: its attributes and behaviors. For example: a dog is an object having attributes such as color, weight, age, etc. and behaviors such as barking, wagging tail, etc. In OOP, attributes are represented by data and behaviors are represented by functions.

Class: A class is the collection of similar objects. It is defined as the template or prototype to define the common attributes and behavior for all the objects of the class. The entire set of data and code of an object can be made a user-defined data type with the help of a class. In fact, objects are variables of type class. Once, a class has been defined, we can create any member of objects associated with that class.

Inheritance: The process of creating a new class form an existing class in which objects of the new class inherit the attributes and behaviors of the existing class is known as inheritance. The newly created class is called derived class or child class and the class from which new class is derived is called base class or parent class. It permits the expansion and reuse of existing code without rewriting it hence, the concept of inheritance supports the concept of reusability.

Types of Inheritance: 


1.       Single Inheritance:  The process of creating a new class from an existing class is called single inheritance i.e., there is only one base class and only one derived class in single inheritance.

2.       Multiple Inheritances:  The process of creating only one new class from several existing classes is called multiple inheritance i.e., there is only one derived class and two or more base classes in multiple inheritance.

3.       Hierarchical Inheritance:  The process of creating several classes from only one class is called hierarchical inheritance that is there are two or more derived classes and only one base class in hierarchical inheritance.

4.       Multilevel Inheritance:  The process of creating a new class from another derived class is called multi-level inheritance.

Polymorphism:  The meaning of polymorphism is having many forms. It is an important feature of OOP which refers to the ability of an object to take on different forms depending upon situations. It simplifies coding and reduces the rework involved in modifying and developing an application.

Data abstraction: In 00P, data abstraction defines the conceptual boundaries of an object. These boundaries distinguish an object from another object. So, abstraction is the act of representing essential features without including the background details. It focuses the outside view of an object, separating its essential behavior from its implementation.

Encapsulation: Encapsulation is a way if organizing data and function into a structure (Called Class) by concealing (hiding) the way the object is implemented, that is preventing acce1ss to data by any means other than those specified. Encapsulation therefore guarantees the integrity of the data contained in the object. It implies that there is visibility to the functionalities offered by an object, and no visibility to its data.

4.       What are the different stages of software planning?

Ans:

Software development life cycle involves the following steps:

In general, an SDLC methodology follows these following steps:

1.     Analysis: In this stage, existing system is evaluated and Deficiencies are identified which is done by interviewing users of the system and consulting with support personnel.

2.     Plan and requirements: In this stage, the new system requirements are defined and the deficiencies in the existing system must be addressed with specific proposals for improvement.  Other factors defined include needed features, functions and capabilities.

3.     Design: In this phase the proposed system is designed. Plans are executed out concerning the physical construction, hardware, operating systems, programming, communications and security issues.

4.     Development: The new system is developed. The new components and programs must be obtained and installed. Users of the system must be trained in its use.

5.     Testing: All aspects of performance must be tested. If necessary, adjustments must be made at this stage. Tests performed by quality assurance (QA) teams may include systems integration and system testing.

6.     Deployment: The system is incorporated in a production environment. This can be done in various ways. The new system can be phased in, according to application or location, and the old system gradually replaced. In some cases, it may be more cost-effective to shut down the old system and implement the new system all at once.

7.     Review and maintenance: This step involves changing and updating the system once it is in place. Hardware or software may need to be upgraded, replaced or changed in some way to better fit the needs of the end-users continuously. Users of the system should be kept up-to-date concerning the latest modifications and procedures.

 

5.       Define the concept of AI and IoT?

Ans:

AI: AI stands for artificial intelligence. It is the branch of science that is concerned with making computer behave like humans. The term AI was first coined by John McCarthy. Artificial Intelligence is one of the emerging technologies which tries to simulate human reasoning in AI systems. AI is the area of computer science focusing on creating machines that can engage on behaviors that humans considered intelligent. John McCarthy invented the term Artificial Intelligence in the year 1950. Application areas of AI are Expert system, Banking, Gaming, Autonomous vehicles, Space exploration, Health Care etc.

IoT: IoT stands for Internet of Things. It is a system of interrelated computing devices, mechanical and digital machines, objects, animals or people that are provided with unique identifiers and the ability to transfer data over a network without requiring human-to-human or human-to-computer interaction. A thing in the internet of thing can be a person with heart monitor implant, a farm animal with biochips transponder, an automobile that has built-in sensor to alert the driver when tire pressure is low or any other natural or man-made object that can be assigned an internet Protocols address and is able to transfer data over a network.


Group C Long Question (2*8=16) 

6.       How do you implement the class C IP address in local area network? Describe.

 Ans:

The IP address range from 192-223 in the first byte and are designed to be used in small-sized companies. Class C addresses are used in small local area networks (LANs). Class C allows for approximately 2 million networks by using the first three octets for the network ID. In a class C IP address, the first three bits of the first octet are always 1 1 0. And the remaining 21 bits of first three octets complete the network ID. The last octet (8 bits) represents the host ID and allows for 254 hosts per network. Class C network number values begins at 192 and end at 223.

In a network IP address is used to identify a particular computer in a network. Every computer connected to a network contains a unique IP address. Here, the IP address is assigned manually by following these steps,

Step-1: Open Network Connections. Open run windows by pressing windows+r keys, type ncpa.cpl and click OK button.

Step 2: Select the network in which you want to assign an IP address. Right click on the selected network, select properties. A network properties window will open.
Step 3: Double click on the TCP/IPv4, an internet protocol version 4 then properties window will open.

Step 4: Select the radio button. Use the IP address such as 192.168.1.5 or any other, Subnet mask as 255.255.255.0 or any other and click on OK button.

If the IP address matches with any computer in the network, an error message stating the IP conflict will be displayed otherwise the assigned IP will be set.

7.       Write a program to input any ten integers in array, sort and display them in ascending order.

    Ans:

#include <stdio.h>

void abc(int a[],int n);

int main()

{

int a[10],n=10,i;

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

{

printf("Enter Numbers in array:");

scanf("%d",&a[i]);

}

abc(a,n);

}

void abc(int a[],int n)

{

int i,j,b;

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

{

for (j=i+1;j<n;j++)

{

if (a[i]>a[j])

{

b=a[i];

a[i]=a[j];

a[j]=b;

}

}

}

printf("\n Numbers in Ascending order are: ");

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

{

printf("%5d",a[i]);

OR

Write a program to read the marks of any five students in a subject and count how many students are pass or fail.

Ans:

#include <stdio.h>

int main()

{

int a[5],b=0,i,j;

for (i=1;i<6;i++)

{

printf("Enter Marks of %d students: \t",i);

scanf("%d",&a[i]);

}

for (i=1;i<6;i++)

{

if (a[i]<40)

{

b=b+1;

}

}

printf("%d student are failed.",b);

Getting Info...

Post a Comment

Please do not enter any spam link in the comment box.
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.