0% found this document useful (0 votes)
143 views

Class XII Computer Science: HOTS (High Order Thinking Skill)

1. The document provides chapter-wise questions on computer science for class 12 based on CBSE pattern with a focus on high-order thinking skills. 2. It includes questions on topics like C++, pointers, classes and objects, inheritance, data structures, DBMS, Boolean algebra, and communication networks. 3. The questions are prepared by different teachers from various Kendriya Vidyalayas and cover both conceptual and application-based questions.

Uploaded by

Janaki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
143 views

Class XII Computer Science: HOTS (High Order Thinking Skill)

1. The document provides chapter-wise questions on computer science for class 12 based on CBSE pattern with a focus on high-order thinking skills. 2. It includes questions on topics like C++, pointers, classes and objects, inheritance, data structures, DBMS, Boolean algebra, and communication networks. 3. The questions are prepared by different teachers from various Kendriya Vidyalayas and cover both conceptual and application-based questions.

Uploaded by

Janaki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 14

Class XII

Computer Science

CHAPTER WISE
HOTS (High Order Thinking Skill)

QUESTIONS
BASED
ON
CBSE PATTERN
Prepared by: PGTs (Computer Science)

1. REVISION TOUR C++, POINTERS – Mrs. Vaishali, KV No.1 Delhi


Cantt.
2. Classes & Objects, Constructor and Destructor, Inheritance, Mr. Pradeep,
KV Chawla
3. Data Structure – Link List, Stacks and Queues, Narsi Lal, KV AGCR
4. Data File handling in c++ - Ms Manpreet Kaur, KV Andrewsganj
5. DBMS & SQL – Mr. Ashok, KV Bawana
6. Boolean Algebra – Harleen Kaur, KV VigyanVihar
7. Communication and Network Concepts – Sanjay Kumar Nama, KV JNU

-2-
Question 1. REVISION TOUR C++, OOPs Concepts & POINTERS

Q 1 WHAT WIIL BE OUTPUT OF FOLLOWING PROGRAM? 1


#include<iostream.h>
# include <conio.h>
void main()
{
clrscr();
int sum(int(*)(int),int);
int square(int);
int cube(int);
cout<<sum(square,4)<<endl;
cout<<sum(cube,4)<<endl;
getch();
}
int sum(int(*ptr)(int k),int n)
{
int s=0;
for(int i=1;i<=n;i++)
{
s+=(*ptr)(i);
}
return s;
}
int square(int k)
{ int sq;
sq=k*k;
return k*k;
}
int cube(int k)
{
return k*k*k;
}

Q2>How many times will the following program will print “examination”? 1
#include<iostream.h>
void main( )
{
while(1)
{
cout<<”examination”
}
}

Q 3> Will the following programs produce same output? 2


Program 1
# include<iostream.h>
# include<conio.h>
void main()

-3-
{
int x,y=1;
if((x=y)!=0)
cout<<x<<" "<<y;
getch();
}

Program 2
# include<iostream.h>
# include <conio.h>
void main()
{
int x,y=0;
if((x=y=1)==1)
cout<<x<<" "<<y;
getch();
}

Q4>What woulg\d be contents of following after array initialization? 1


int A[5]={3,8 ,9}

Q5>Suggest storage class for following variables ½ each


1. a normal variable.
2. very heavily used variable.
3. a variable that should retain its value after function is over.
4. a variable that spans multiple files.
5. a variable global in one & not available in another file.

Q 6> “Pointers always contain integers “ Comment. 1

Classes & Objects, Constructor and Destructor, Inheritance

Q.1 What is the difference between the constructor and normal function?

Q.2 What is the similarity between class and the constructor? (HOTS)/Bright Student

Q.3 Find the output of the following program?


#include<iostream.h>
#include<conio.h>
#include<string.h>
class state
{ char *statename;
int size;
public:
state(){size=0;statename=new char[size+1];}
state (char *s)
{ size=strlen(s);statename=new char[size+1];
strcpy(statename,s);
}

-4-
void display()
{ cout<<statename<<endl;}
void replace(state&a, state &b)
{size=a.size+b.size;
delete statename;
statename=new char[size+1];
strcpy(statename, a.statename);
strcat(statename,b.statename);
}
};
void main()
{ clrscr();
char *temp="Delhi";
state state1(temp), state2("Mumbai"), state3("Nagpur"), s1,s2;
s1.replace(state1,state2);
s2.replace(s1,state3);
s1.display();
s2.display();
getch();
}

Q.3 Find out errors in the following program:-


class number
{
int x=10;
float y;
number(){ x=y=10;}
public:
number(number t)
{
x=t.x; y=t.y;
}
~ (){ cout<<"Object destroyed ";}
}
main()
{
number a1, a2(a1);
}

Q.4 What is the difference between nesting or containership and inheritance? Explain with example?
Q.5 What will be the output of the program?
#include<iostream.h>
class base
{ public:
void display()
{
cout<<"It is a base class "<<endl;
}
};
class derived: public base

-5-
{
public:
void display()
{ cout<<"It is a derived class "<<endl;}
};
main()
{
derived ob1;
ob1.display();
}

Q.6 Define a class named Tour in C++ with following description? 4


Private members:
tcode integer (Ranges 6 - 10)
adults, children, distance integer
totalfare float
AssignFare( ) A function which calculates and assign the value to data member
totalfare as follows:-
- For adults Fare Distance
Rs. 500 >=1500
And fare get reduced by 25% if distance is < 1500.
- For Children
For every child a fixed Rs. 50 is charged as fare.
Public members:
 A constructor which initialized initialize all data members with 0
 Function EnterTour() to input the values of the data members tcode, adults, children and call to AssignFare
function.
 Function ShowTour() to print all the details of object of Travel type.

Q.7. Define a class named Admission in C++ with following description? 4


Private members:
admno integer (Ranges 10-1500)
name string of 20 characters
cls integer
fees float
Public members:
A constructor which initialized admno with 10, name with “NULL”, cls with 0 & fees with 0
Function getdata() to read the object of Admission type.
Function putdata() to print the details of object of admission type.
Function draw_nos() to generate the admission no. randomly to match with admno and display the detail of
object.

Q.8
Class testmeout
{ int rollno;
public:
~testmeout() //Function 1
{ cout<<rollno<<” is Leaving examination hall”<<endl;
}
testmeout() //Function 2
{ rollno=1;

-6-
cout<<rollno<<” is appearing for examination “<<endl;
}
testmeout(int n, char name[]) //Function 3
{ rollno=n;
cout<<name<<” is in examination hall”<<endl;
}
testmeout(testmeout & t);//function 4
void mywork() //Function 5
{ cout<<rollno<<” is attempting questions “<<endl;
}
};

i) In object oriented programming, what is Function 1 referred as and when does it get invoked?
ii) In object oriented programming, what is Function 2 referred as and when does it get invoked?
iii) In object oriented programming, what is Function 3 referred as and when does it get invoked?
iv) Write a statement so that function 3 gets executed?
Complete the definition of function 4
v) What will be the output of the above code if its main function definition is as given below (assumed the
definition of Function 4 is completed ) :
main()
{testmeout ob1;
ob1.mywork();
}
vi) Which feature of object oriented programming is demonstrated using Function 2, Function 3 and Function 4
in the above class testmeout?
vii) What is the scope of data member (rollno) of class testmeout? What does the scope of data members depend
upon?

Data Structure – Array, link List, Stack & Queue


Q. 1 Given two arrays of integers A and B of sizes M and N respectively. Write a function named MIX() which
will produce a third array named C, such that the following sequence is followed :
All even numbers of A from left to right are copied into C from left to right.
All odd numbers of A from left to right are copied into C from right to left
All even numbers of B from left to right are copied into C from left to right.
All odd numbers of B from left to right are copied into C from right to left
A, B and C are passed as arguments to MIX().
e.g. : A is {3,2,1,7,6,3} and B is {9,3,5,6,2,8,10}, the resultant array C is {2,6,6,2,8,10,5,3,9,3,7,1,3}

Q. 2. Suppose an array P containing float is arranged in ascending order. Write a user defined function in C++
to search for one float from P with the help of binary search method. The function should return an integer 0 to
show absence of the number and integer 1 ti show presence of the number in the array. The function should have
the parameters as (1) an array (2) the number DATA to be searched (3) number of element N.

Q. 3 Write a function in C++ which accepts an integer array and its size as arguments / parameters and
assign the elements into a two dimensional array of integers in the following format :
If the array is 1, 2,3,4,5,6 If the array is 1,2,3

-7-
The resultant 2D array is given below The resultant 2D array is
1 2 3 4 5 6 given below
1 2 3 4 5 0 1 2 3
1 2 3 4 0 0 1 2 0
1 2 3 0 0 0 1 0 0
1 2 0 0 0 0
1 0 0 0 0 0

Q-4 Write a function in C++ to perform a PUSH operations on a dynamically allocated stack containing real
number? Given node as :

struct Node
{
float data;
Node * next;
};
Q-5 Each node of a STACK containing the following information, in addition to required pointer field:
Roll no. of the student
Age of the student.
Gve the structure of node for the linked stack in question.
TOP is a pointer to the topmost node of the STACK. Write the following function:
PUSH() – TO push a node in to the stack which is allocated dynamically.
POP() – Te remove a node from the stack and to release the memory.

Q.6 Write a function MAX in C++ which will return the Largest number stored in a two dimensional array of
Integers.

Q.7 Write a function in c++ which accepts a 2D array of integers and its size as arguments and displays the
elements which lies on diagonals.
[ Assuming the2D array to be a square matrix with odd dimensions , i.e 3x3, 5x5,7x7, etc ]

Example if the array content is


543
678
129
Output through the function should be
Diagonal one : 5 7 9
Diagonal two : 3 7 1 .

Q.8 Write a function in C++ which accepts a 2D array of integers and its size as arguments and displays the
elements of the middle row and the elements of middle column.
Example if the array content is
354
769
218
Output through the function should be:
Middle row: 769 Middle column: 5 6 1

-8-
Q. 9. Declare a stack using array that contains int type numbers and define pop and push function using C++
Syntax.
Q.10. Define functionstackpush( ) to insert nodes and stack pops ( ) to delete nodes . for a linked list
implemented stack having the following structure for each node
struct Node
{
Char name [ 20 ]
Int age ;
Node * link ;
};
Class stuck {
Node * top ;
Public
Stack ( ) { top = null ;} ;
Void stackpush ( );
Void stack pop ( ) ;
}

DATA FILE HANDLING


Q1, Assuming the class Vehicle as follows:
Class vehicle
{ char vehicletype[10];
int no_of wheels;
public:
void getdetials()
{ gets(vehicletype);
cin>>no_of_wheels;
}
void showdetails()]
{ cout<<”Vehicle Type”<<vehicletype;
cout<<”Number of Wheels=”<<no_of_wheels;
}
}
Write a function showfile() to read all the records present in an already exiting binary file SPEED.DAT and
display them on the screen ,also count the number of records present in the file.

Q2. Write a program that prints a text file on the printer.

Q3. Write a c++ program ,which initializes a string variable to the content.”Time is a grat teacher but
unfortunately it kills all its pupils.Berlioz”and output the string one character at a time to the disk file
OUT.TXT .You have to include all the header files required.

Q4. Write a program that display the size of a file in bytes.

Q5. What will be the output produced by the following code?


#include<iostream.h>
#include<fstream.h>
#include<process.h>
#include<conio.h>
int main()
{

-9-
clrscr()
char filename[13];
cout<<”Enter Filename:”;
cin.getline(filename,13);
ifstream in(filename);
if(!in)
{cout<<”Cannot open input file!\n”;
return (0)
}
Char str[255];
While(in)
{in.getline(str,255);
Cout<<str<<”\n”;
}
in.close();
return 0;
}

DATA BASE CONCEPT

Q.1. What is foreign Key? What is its purpose?

Q.2. Define the terms Tuple and Attribute

Q.3. What do you understand by the terms Cardinality and Degree of the table?

Q.4. What is the main function of DBA.

Q.5. Write a query on the customers table whose output will exclude all customers with a rating <=100,
unless they are located in Shimla.

Q.6. Write a query that selects all orders except those zeros or NULLs in the amount field.

Q.7. Write a query that lists customers in descending order of rating.


Output the rating field first, followed by the customer’s name and number.

Q.8. Write a command that puts the following values, in their given order, into the salesman table:
cust-name-Manisha, city-Manali, comm.- NULL, cust-num-1901.

Q.9. What are DDL and DML?

Q.10. What is the difference between Where and Having Clause ?


Q.11. What do you understand by constraints ?

- 10 -
Q.12. Write some features of SQL?

Q.13. Write various database objects available in SQL?

Q.14. Write the rules to name an objects?

Q.15. What are group Functions

Q.16. What are column alias?

Q.17. Write the SQL query commands based on following table

Table : Book
Book_id Book name Author_name Publisher Price Type Quantity
C0001 Fast Cook Lata Kapoor EPB 355 Cookery 5
William
F0001 The Tears Hopkins First Publi. 650 Fiction 20
Brain &
T0001 My First c++ Brooke FPB 350 Text 10
C++ Brain
T0002 works A.W. Rossaine TDH 350 Text 15
F0002 Thunderbolts Anna Roberts First Publ. 750 Fiction 50

Table : issued 
Book_Id Quantity Issued
T0001 4
C0001 5
F0001 2

Write SQL query for (a) to (f)


(a) To show book name, Author name and price of books of First Pub. Publisher
(b) To list the names from books of text type
(c) To Display the names and price from books in ascending order of their prices.
(d) To increase the price of all books of EPB publishers by 50.
(e) To display the Book_Id, Book_name and quantity issued for all books which have been issued
(f) To insert a new row in the table issued having the following data. ‘F0003’, 1
(g) Give the output of the following
i. Select Count(*) from Books
ii. Select Max(Price) from books where quantity >=15
iii. Select book_name, author_name from books where publishers=’first publ.’
iv. Select count(distinct publishers) from books where Price>=400

Q.18.
TABLE: GRADUATE
S.NO NAME STIPEND SUBJECT AVERAGE DIV.
1 KARAN 400 PHYSICS 68 I
2 DIWAKAR 450 COMP. Sc. 68 I

- 11 -
3 DIVYA 300 CHEMISTRY 62 I
4 REKHA 350 PHYSICS 63 I
5 ARJUN 500 MATHS 70 I
6 SABINA 400 CEHMISTRY 55 II
7 JOHN 250 PHYSICS 64 I
8 ROBERT 450 MATHS 68 I
9 RUBINA 500 COMP. Sc. 62 I
10 VIKAS 400 MATHS 57 II
(a) List the names of those students who have obtained DIV I sorted by NAME.
(b) Display a report, listing NAME, STIPEND, SUBJECT and amount of stipend received in a year
assuming that the STIPEND is paid every month.
(c.) To count the number of students who are either PHYSICS or COMPUTER SC graduates.
(d) To insert a new row in the GRADUATE table:
11,”KAJOL”, 300, “COMP. SC.”, 75, 1
(e) Give the output of following sql statement based on table GRADUATE:
(i) Select MIN(AVERAGE) from GRADUATE where SUBJECT=”PHYSICS”;
(ii) Select SUM(STIPEND) from GRADUATE WHERE div=2;
(iii) Select AVG(STIPEND) from GRADUATE where AVERAGE>=65;
(iv) Select COUNT(distinct SUBDJECT) from GRADUATE;
Assume that there is one more table GUIDE in the database as shown below:
Table: GUIDE
MAINAREA ADVISOR
PHYSICS VINOD
COMPUTER SC ALOK
CHEMISTRY RAJAN
MATHEMATICS MAHESH

(f) What will be the output of the following query:


SELECT NAME, ADVISOR FROM GRADUATE,GUIDE WHERE SUBJECT= MAINAREA;

Q.19. Table: Employees


Empid Firstname Lastname Address City
010 Ravi Kumar Raj nagar GZB
105 Harry Waltor Gandhi nagar GZB
152 Sam Tones 33 Elm St. Paris
215 Sarah Ackerman 440 U.S. 110 Upton
244 Manila Sengupta 24Friends street New Delhi
300 Robert Samuel 9 Fifth Cross Washington
335 Ritu Tondon Shastri Nagar GZB
400 Rachel Lee 121 Harrison St. New York
441 Peter Thompson 11 Red Road Paris
Table: EmpSalary
Empid Salary Benefits Designation
010 75000 15000 Manager
105 65000 15000 Manager
152 80000 25000 Director
215 75000 12500 Manager
244 50000 12000 Clerk
300 45000 10000 Clerk
335 40000 10000 Clerk
400 32000 7500 Salesman
441 28000 7500 salesman

- 12 -
Write the SQL commands for the following :
(i) To show firstname,lastname,address and city of all employees living in paris
(ii) To display the content of Employees table in descending order of Firstname.
(iii) To display the firstname,lastname and total salary of all managers from the tables Employee and
empsalary , where total salary is calculated as salary+benefits.
(iv) To display the maximum salary among managers and clerks from the table Empsalary.
(v) Give the Output of following SQL commands:
(i) Select firstname,salary from employees ,empsalary where designation = ‘Salesman’ and
Employees.empid=Empsalary.empid;
(ii) Select count(distinct designation) from empsalary;
(iii) Select designation, sum(salary) from empsalary group by designation having count(*) >2;
(iv) Select sum(benefits) from empsalary where designation =’Clerk’;

Boolean Algebra

1. Prove that X.(X+Y)=X by algebraic method.


2. Give duals for the following :
a) A+ ĀB
b) AB+ĀB

3. State and verify Involution law.

4. State and verify Duality principle.

5. State and verify Absorption law in boolean algebra.

6. Draw logic circuit diagram for the following expression:

7. State the distributive laws of boolean algebra.

8. Reduce the following Boolean expression using K-Map:


F(P,Q,R,S)=Σ(0,3,5,6,7,11,12,15)

9. Reduce the following Boolean expression using K-Map:


F(A,B,C,D)=∏(0,1,3,5,6,7,10,14,15)

- 13 -
Communication and Network Concepts

Q.1 What is protocol? How many types of protocols are there?

Q.2 What is the difference between Networking and Remote Networking?

Q.3 What is point-to-point protocol?

Q.4 How gateway is different from router?

Q.5 What is the role of network administrator?

Q.6 What is the difference between baseband and broadband transmission?

Q.7 What are the difference between domain and workgroup?

Q.8 What is the differences between POP3 and IMAP Mail Server?

Q.9 Name different layer of the ISO OSI Model.

Q.10 What is client server architecture?

Q.12 What is FDM? Give example.

Q.13 describe the following in brief:


i) MOSAIC ii) USENET iii) WAIS

- 14 -

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy