12th Standard CBSE Syllabus & Materials
12th Standard CBSE
CBSE 12th Economics Government Budget and the Economy Previous year Question Papers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Computer Science Interface Python with MySQL - New Previous year Question Papers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Computer Science Database Concept - New Previous year Question Papers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Computer Science Data Communication - New Previous year Question Papers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Computer Science Data Structures - New Previous year Question Papers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Computer Science Functions - New Previous year Question Papers Study Material - QB365 Set A

Published on: 29/12/2018
12th Class Full Test
Download CBSE Class 12th Standard CBSE Computer Science question papers, sample papers, important questions, and previous year solved papers in PDF format. Get free study materials, NCERT solutions, and exam preparation resources for Class 12th Standard CBSE Computer Science
Questions + Answers key
Take MCQ Computer Science Test

1.
Evaluate the following postfix expression using a stack and show the contents after execution of each operation:
100,40,8,+,20,10,-,+,*/
2.
Consider the following sequence of numbers:
1,2,3,4
These are supposed to be opeated through a stack to produce the following sequence of numbers:
2,1,4,3
List the push and pop operations to get the required output.
3.
To display the matrix using nested loop
4.
To show the data members are passed by value.
5.
To check the number is divisible by 6 or not using nested if statement
6.
Write a function in C++ to insert an element in a dynamically allocated queue,where each node contains a Name(char) as data.Assume the following definition of THENODE for the same:
structTHENODE
{
char Name[20];
THENODE *Link;
};
7.
Given the following C++ code, answer the question (i) and (ii)
class Testmeout
{
public:
~Testmeout()
{
cout<<"Leaving the examination hall";
cout<<end1;
}
Testmeout()
{
cout<<"Appearing examination hall:;
cout<<end1;
}
void Mynetwork()
{
cout<<"Atempting question"<<end1;
}
};
(i) in object oriented programming, what Function 1 is referred as and when does it get invoked/called?
(ii) in object oriented programming, what Function 2 is referred as and when does it get invoked/called?
8.
Write a function COUT_TO() in C++ to cout the presence of aworld 'to' in text file NOTES.TXT is as it is very important to know that smoking is injurious to health,let us take initiative to stop it.The function COUT_TO()will display the following message cout of-to=in file:3
9.
Write a program to print the following output after inputting the value of n. The user should be prompted again for the value of n, if the inputted value does not lie between 1 to 6 do the inclusive.
1
1 2 3
1 2 3 4 5
1 2 3 4 5 6 7
- - - - - - -
1 2 - - - - - - (2n-1)
10.
Answer the questions (a) and (b) on the basis of the following tables SHOPPE and ACCESSORIES.
TABLE SHOPPE
| Id | SName | Area |
| S001 | ABC Computeronics | CP |
| S002 | All Infotech Media | GK II |
| S003 | Tech Shoppe | CP |
| S004 | Geeks Tecno Soft | Nehru Place |
| S005 | Hitech Tech Store | Nehru Place |
TABLE ACCESSORIES
| No | Name | Price | Id |
| A01 | Mother Board | 12000 | S01 |
| A02 | Hard Disk | 5000 | S01 |
| A03 | Keyboard | 500 | S02 |
| A04 | Mouse | 300 | S01 |
| A05 | Mother Board | 13000 | S02 |
| A06 | Keyboard | 400 | S03 |
| A07 | LCD | 6000 | S04 |
| T08 | LCD | 5500 | S05 |
| T09 | Mouse | 350 | S05 |
| T10 | Hard Disk | 4500 | S03 |
(a) Write the SQL queries:
(i) To display Name and price of all the Accessories in ascending order of their price.
(ii) To display id and Sname of all Shoppe located in Nehru place.
(iii) To display Minimum and Maximum price of each Name of Accessories.
(iv) To display Name,Price of all Accessories and their respective SName,where they are available.
(b) Write the output of the following SQL commands;
(i) SELECT DISTINCT NAME FROM ACCESSORIES WHERE PRICE>=5000;
(ii)SELECT AREA.COUNT (*) FROM SHOPPE GROUP BY AREA;
(iii)SELECT COUNT (DISTINCT AREA) FROM SHOPPE;
(iv)SELECT NAME,PRICE*0.05 DISCOUNT FROM ACCESSORIES WHERESNO IN ('S02','S03');
11.
Suppose we have following C++ program:
#include<iostream.h>
#include<conio.h>
class A
{
public:
A(){cout<<"A";}
\(\sim \)A(){cout<<"\(\sim \)A";}
};
class B
{
public:
B(){cout<<"B";}
\(\sim \)B(){cout<<"\(\sim \)"B";}
};
class C
{
public:
C(){cout<<"C";}
\(\sim \)C(){cout<<"\(\sim \)"C";}
private:
B a; A b;
};
class D
{
public:
D(){cout<<"D";}
\(\sim \)D(){cout<<"\(\sim \)"D";}
};
class E : public C
{
public:
E(){cout<<"E";}
\(\sim \)E(){cout<<"\(\sim \)"E";}
private:
D d; B b;
};
void main()
{
E e;
cout<<end l;
getch();
}
Assume that the program compiles and runs correctly, what does it print out?
12.
test questions
13.
Convert the following boolean expression into its equivalent canonical Sum of Product(SOP) form.
\((\bar { U } +V+\bar { W } ).(U+\bar { V } +\bar { W } ).(U+V+W)\)
14.
Explain the following terms in short:
(i) DHTML
(ii) ISP
15.
Write a function MAX in c++, which will return the largest number stored in a two dimensional array of integer.
16.
Find the output of the following program:
#include<iostream.h>
void ChangeArray(int Number, int Arr[],int Size)
{
for(int L=0;L<Size;L++)
if(L<Number)
ARR[L] += L;
else
ARR[L] *= L;
}
void show(int ARR[],int size)
{
for(int L=0;L<size;L++)
(L%2 !=0)?cout<<ARR[L]<<"#":cout<<ARR[L]<<endl;
}
void main()
{
int Array[]={30,20,40,10,60,50}:
changeArray(3,Array,6);
show(Array,6);
}
17.
Write a Get2From1() function in c++ to transfer the content from one array ALL[] to two different arrays odd[] and even[].
The odd[] array should contain the value from odd position (1,3,5,...) of ALL[] and Even[] array should contain the values from places(0,2,4,...) of ALL[].
e.g
The ALL[] array should contain
12,34,56,67,89,90
if the odd[] array contains
34,67,90
and the Even[] array contain
12,56,89
18.
What is the benefit of using function prototype for a function? Give a suitable example to illustrate it using a C++ code.
19.
Define a class RESTRA in C++ with following descriptions:
private members
| FType | Sticker |
| Vegetarian | GREEN |
| Contains Egg | YELLOW |
| Non-vegetarian | RED |
Public members
20.
Rewrite the following program after removing the syntactical errors(if any).underline each corrections.
#include[iostream.h]
#include[stdio.h]
cass Employee
{
int Empid = 901;
char Ename[20];
public
Employee()
{}
void joining()
{
cin>>Empid;
gets(Ename);
}
void list()
{
cout<<Empid<<":"<<Ename<<end1;
}
};
void main()
{Employee E;
Joining.E()
E.list();
}
21.
What do yo understand by default constructor and copy constructor function used in classes? How are these functions different from normal constructor?
22.
What is the need of normalization?
23.
Write the Product of Sum(POS) form of the function F(X, Y, Z) for the following truth table representation of F:
| X | Y | Z | F |
| 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
24.
Write the full form of the following:
(i) GNU
(ii) XML
25.
Give the SQL statement to create a table STUDENT with Roll Number, Name, Age and Marks.
26.
Is it necessary to include a header file in a program? If it is not done, what happens?
27.
How does a compiler decide as to which function should be invoked when there are many functions with the same name?
1.
The stack operation is:
| Scanned Elements | Operation | Stack Status |
| 100 | PUSH 100 | 100 |
| 40 | PUSH 40 | 100,40 |
| 8 | PUSH 8 | 100,40,8 |
| + | POP 8 AND POP 40 calculate 40+8=48 PUSH 48 |
100,48 |
| 20 | PUSH 20 | 100,48,20 |
| 10 | PUSH 10 | 100,48,20,10 |
| - | POP 10 and POP 20 calculate 20-10=10 PUSH 10 |
100,48,10 |
| + | POP 10 and POP 48 calculate 48+10=58 PUSH 58 |
100,58 |
| * | POP 58 and POP 100 calculate 58*100=5800 PUSH 5800 |
5800 |
2.
(i) push (1)
(ii) push (2)
(iii) pop (2)
(iv) pop (1)
(v) push (3)
(vi) push (4)
(vii) pop (4)
(viii) pop (3)
3.
#include<iostream.h>
#include<conio.h>
void main()
{
int i, j;
for(i=1; i<=3; i+=2) //Outer for() loop
{
for(j=1; j<=1; j++) //Inner for() loop
cout<<=<<" "<<j<<endl;
}
getch();
}
Output
1 1
3 1
4.
Output
Enter the time
HOURS 10
MINUTES 50
SECONDS 30
Enter the time
HOURS 12
MINUTES 15
SECONDS 40
Resultant time
HOURS 23
MINUTES 6
SECONDS 10
5.
#include<iostream.h>
#include<conio.h>
void main()
{
int num;
clrscr();
cout<<" enter the number";
cin>>num;
if(num%2==0)
{
if(num%3==0)
cout<<"Number is divisible by 6';
else
cout<<"Number is not divisible by 6';
}
else
cout<<" The number is not divisible by 2 so, it is not divisible by 6";
getch();
}
Output
Enter the number 30
Number is divisible by 6
6.
void insert(THENODE *rear)
{
THENODE *newptr=new THENODE;
newptr->Link=NULL;
cout<<"Enter name for new NODE";
gets(newptr->Name);
if(rear==NULL)
{
front=rear=newptr;
}
else
{
rear->Link=newptr;
rear=newptr;
}
}
7.
(i) Function 1 is referred to as destructor and it gets invoked when an object goes out of scope.
(ii) Function 2 is referred to as destructor and it gets invoked when an object gets created.
8.
void COUNT_TO()
{
ifstream fin("NOTES.TXT");
Char str[10];
int C=0;
while(!fin.eof())
{
fin>>str;str[0]=tolower(str[0]);
if(strcmp(str,"0")==0)
C++;
}
fin.close();
cout<<"Cout of-to-in file:"<
}
9.
#include<iostream.h>
#include<conio.h>
void main()
{
int a;
do
{
cout<<"Enter a";
cin>>a;
}
while((a<1)||(a<6));
for(int i=0;i<=a;i++)
{
for(int k=1;k<=(a-i);k++)
cout<<" "<<" ";
for(int j=1;j<=(2*i-1);j++)
cout<<j<<" "<<" ";
cout<<"\n";
}
getch();
}
10.
(a)(i) SELECT Name, Price
FROM ACCESSORIES
ORDER BY Price;
(ii) SELECT Id, SName
FROM SHOPPE
WHERE Area='Nehru Place';|
(iii) SELECT MIN(Price)"Minimum Price",
MAX(Price) "Maximum Price", Name
FROM ACCESSORIES
GROUP BY Name;
(iv) SELECT Name,Price, SName
FROM ACCESSORIES A, SHOPPE S
WHERE A.Id=S.Id;
but this query enable to show the result because A.Id and S.Id are not identical.
(b)(i)
| NAME |
| MotherBoard |
| Hard Disk |
| LCD |
(ii)
| AREA | COUNT(*) |
| GK II | 1 |
| Nehru Place | 2 |
| CP | 2 |
(iii)
| Count(Distinct area) |
| 3 |
(iv) The given query will result in an error as there is no column named SNo in ACCESSORIES table.
11.
BACDBE
\(\sim E\sim B\sim D\sim C\sim A\sim B\)
12.
test questions 11
13.
\((\bar { U } +V+\bar { W } ).(U+\bar { V } +\bar { W } ).(U+V+W)\)
=(101).(011).(000)
=M5,M3,M0=\(\prod (0,3,5)\)
SOP expression will be = \(\sum (1,2,4,6,7)\)
= m1+m2+m4+m6+m7
= (001)+(010)+(100)+(110)+(111)
=\((\bar { u } .\bar { v } .w)+(\bar { u } .v.\bar { w } )+(u.\bar { v } .\bar { w } )+(u.v.\bar { w } )+(u.v.w)\)
14.
(i) DHTML DHTML stands for Dynamic HyperText Markup Language. It refers to the web content that changes according to the user request. It will react the user input without sending requests to the web server.
(ii) ISP ISP stands for Internet Service Provider. It refers to the company that provides Internet Services. Some common examples of ISPs are Airtel, BSNL, Tata docomo, etc.
15.
int MAX(int a[10][10], int m, int n)
{
int MAX = a[0][0];
for(int i=0;i<n;i++)
{
if(a[i][j]>MAX)
max = a[i][j];
}
return max;
}
16.
The output will be :
30
21#42
30#240
250#
17.
void Get2from1(int ALL[],int N)
{
int j=0,k=0;
int odd[10],Even[10];
{
if ((i%2) == 0)
{
Even[j++] =ALL[i];
}
else
{
Odd[k++] = ALL[i];
}
}
}
18.
The function prototype serves to ensure that calls to the function are made with the proper number and types of arguments.In the case of function overloading the different prototypes serve to distinguish which version of the function to call.
The compiler will complain with an error if no function prototype is found for any particular call to a function.
e.g.Program to illustrate use of function prototyping.
#include<iostream.h>
int square(int); //Function prototype
int main()
{
for(int x=1;x<=10;x++)
cout<<square(x)<<" ";
cout<<endl;
return 0;
} //Function definition
int square(int y)
{
return(y*y);
}
19.
class RESTRA
{
int FoodCode;
char Food[30],FType[20],Sticker[20];
void GetSticker()
{
if(strcmp(FType,"Vegeterian")==0)
strcpy(Sticker,"GREEN");
else if(strcmp(FType,"Contains Egg")==0)
strcpy(Sticker,"YELLOW");
else if(strcmp(FType,"Non-vegetarian")==0)
strcpy(Sticker,"RED");
}
public:
void GetFood()
{
cout<
gets(Food);
gets(FType);
}
20.
#include<iostream.h>
#include<stdio.h>
cass Employee
{
int Empid;
char Ename[20];
public:
Employee()
{
Empid = 901;
}
void joining()
{
cin>>Empid;
gets(Ename);
}
void list()
{
cout<<Empid<<":"<<Ename<<end1;
}
};
void main()
{
Employee E;
E.Joining()
E.list();
}
21.
Default constructor A constructor get invoked without any parameter is called default constructor.
copy constructor A copy constructor is a constructor that gets invoked when an object is created as copy of another existing object.
e.g:
class ABC
{
int a;
public:
ABC() //Default constructor
{
a = 0;
}
ABC(ABC &t) //Copy constructor
{
a = t.a;
}
};
22.
The normalisation is the process of transformation of the relationship among data elements in a record.Normalisation replaces a collection of data in a record structure by another record design which is simpler, more predictable and therefore more manageable.
23.
( )
| X | Y | Z | F | Maxterms |
| 0 | 0 | 0 | 1 | X+Y+Z |
| 0 | 0 | 1 | 0 | \(X+Y+\bar { Z } \) |
| 0 | 1 | 0 | 0 | \(X+\bar {Y}+ { Z } \) |
| 0 | 1 | 1 | 1 | \(X+ \bar {Y}+\bar { Z } \) |
| 1 | 0 | 0 | 0 | \(\bar {X}+ Y+Z \) |
| 1 | 0 | 1 | 0 | \(\bar {X}+ Y+\bar { Z } \) |
| 1 | 1 | 0 | 1 | \(\bar {X}+ \bar {Y}+Z \) |
| 1 | 1 | 1 | 1 | \(\bar {X}+ \bar {Y}+\bar { Z } \) |
POS form of function F(X, Y, Z) is: \((X+Y+\bar { Z } ).(X+\bar { Y } +Z).(\bar { X } +Y+Z).(\bar { X } +Y+\bar { Z } )\)
24.
( )
(i) GNU GNU's NOT UNIC
(ii) XML eXtensible Markup Language
25.
( )
CREATE TABLE STUDENT( ROLL Number NUMBER(5) Primary key, Name CHAR(20), Age NUMBER(2), MARKS NUMBER(4));
26.
( )
If input/output processing or any functioning is required then a header file appropriate for it must be included. In the absence of any header file, we can only declare variables and assign values to it but no input/output or specific functioning can take place.
27.
( )
The compiler differentiates between functions with same name by the number of arguments and the data type of arguments that are given with function declaration and the function call.
12th Standard CBSE Syllabus & Materials
12th Standard CBSE
CBSE 12th Computer Science Python Revision Tour I - New Previous year Question Papers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Business Studies Planning Important Questions And Answers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Business Studies Business Environment Important Questions And Answers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Business Studies Principles of Management Important Questions And Answers Study Material - QB365 Set A
CBSE 12th Standard CBSE Subjects
CBSE Standards