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
Class 12 Model Question
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.
State and verify associative law.
2.
Represent \((P+\bar { Q } R)\) in POS form
3.
Explain the following terms in short:
(i) DHTML
(ii) ISP
4.
An array MAT[30][10] is stored in the memory along the column with each of the element occupying 2 bytes. Find out the base address and address of element MAT[20][5], if an element MAT[5][7] is stored at the memory location 1000.
5.
An array p[15][10] is stored along the column in the memory wich each element requiring 8 bytes of storage. if the base address of array T is 14000, find out the location of T[10][7].
6.
Rewrite the following program after removing the syntactical errors,if any.Underline each correction.
#include<iostream.h>
void main()
{
struct STUDENT
{
char stu_name[20];
char stu_sex;
int stu_age=17;
}student;
gets(stu_name);
gets(stu_sex);
}
7.
Rewrite the following program after removing the syntactical errors(if any). Underline each correction.
#include<iostream.h>
typedef char Text(80);
void main()
{
Text T="Indian";
int Count=strlen(T);
cout<<T<<'has'<<Count<<'characters'<<endl;
}
8.
What do you understand by a member function?How does a member function differ from an ordinary function?
9.
A database is to contain information about person and skills. At a particular time, the following persons are represented in the database, and their skills are as indicated
| Person | Skills |
| Vikas | Engineering |
| Harvinder | Programming |
| Ritesh | Operating and Engineering |
For each person, the database contains several details like Mobile number, Address. For each skill, it contains an identification of the appropriate skill and other information. Draw a relational view for this data.
10.
Rewrite the following program after removing the syntactical errors (if any). Underline each correction.
#include<iostream.h>
class Item
{
long IId, Qty;
public:
void Purchase
{
cin>>IId>>Qty;
}
void Sale( )
{
cout<<setw(5)<<IId<<"old:"<<Qty<<end1;
cout<<"New:"<<- -Qty<<end1;
}
} ;
void main( )
{
Item I;
Purchase( );
I.Sale( );
I.Sale( )
}
11.
What do you understand by primary key? Give a suitable example of the primary key from a table containing some meaningful data.
12.
Why is data encapsulation so important in C++?
13.
Differentiate between a run-time error and syntax error. Also, give suitable examples of each in C++.
14.
test quewtsion s testkavin
15.
Evaluate the following postfix expression showing the status after execution of each step:
10,40,+,8,2,+,*,10,-
16.
Find the output of the following program:
#include<iostream.h>
void main()
{
int X[]={10,25,30,55,110};
int *p=X;
while(*p<100)
{
if(*p%3!=0)
*p=*p+1;
else
*p=*p+2;
p++;
}
for(int I=4;i>1;i--)
{
cout<<x[i]<<"*";
if(I%3==0)
cout<<end1;
}
cout<<X[0]*3<<end1;
}
17.
To print the numbers using break statement.
18.
To show the working of function returning object.
19.
Answer the question (i) to (iv) based on the following:
class COMPNAY
{
char location[20];
double budget, income;
protected:
void Accounts();
public:
COMPANY();
void Register();
void Show();
};
class FACTORY : public COMPANY
{
char location[20];
int workers;
protected:
double salary;
void Computer();
public:
FACTORY();
void Enter();
void Show();
};
class SHOP : private COMPANY
{
char location[20];
float area;
double sale;
public:
SHOP():
void Input();
void Output();
};
(i) Name the type of inheritance illustrated in the above C++ code.
(ii) Write the name of data members, which are accessible from the member function of class SHOP.
(iii) Write name of all the data member function, which are accessible from object belonging to class FACTORY.
(iv) Write the name of all the members, which are accessible from objects of classShop.
20.
Write a function in C++ to perform push operation in a dynamically allocated stack containing admission numbers of students. Also,declare the relevant class/structure and points.
21.
Write a function in C++ to count number of uppercase alphabets prsent in a text file ARTICLE.TXT.
22.
List the output of the program below.In other words, everytime there is a cout statement, list the values that will appear on the screen.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
for(int i=1;i<3;i++)
for(int j=1;j<=5;j+=2)
cout<<i<<"*"<<j<<"="<<i*j<<endl;
double a=1;
while(a<32)
a*=2;
cout<<"a="<<a<<endl;
i=8,j=3;
int k=i/j;
double b=i/j;
double c=((double)i/(double)j);
cout<<"Now k="<<k<<", b="<<b<<", c="<<c<<endl;
getch();
}
23.
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');
24.
Answer the questions (i) to (iv) based on the following code:
class FRUIT
{
int FID;
//Identification number
char type[20];
protected:
char Description[20];
float Cost;
public:
FRUIT();
void Set_values();|
void Show_values();
};
class FRESH : public FRUIT
{
char color[10];
protected:
char Agent[20];
public:
FRESH();
void Read-values();
void Display_values();
};
class DECORATIVE : protected FRUIT
{
float Dec_charges;
public:
void input();
void output();
};
(i) Write the names of data members, which are accessible by objects of class type DECORATIVE.
(ii) Write the names of all member functions, which are accessible by the member functions of class FRESH.
(iii) Name the type Inheritance used in the above class?
(iv) How many bytes will be required by an object of class type DECORATiVE?
25.
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 |
26.
What is voip?
27.
Differentiate between SQL commands DROP TABLE and DROP VIEW.
28.
How does a compiler decide as to which function should be invoked when there are many functions with the same name?
29.
How 'I' operator is different from '%' operator?
1.
The associative law states:
(i) X+(Y+Z)=(X+Y)+Z
(ii) X.(Y.Z)=(X.Y).Z
Verification:
(i) Truth table of X+(Y+Z)=(X+Y)+Z
| X | Y | Z | Y+Z | X+Y | X+(Y+Z) | (X+Y)+Z |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 1 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 | 1 | 1 | 1 |
| 1 | 1 | 0 | 1 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 |
Both columns X+(Y+Z) and (X+Y)+Z are identical.
\(\therefore \) X+(Y+Z)=(X+Y)+Z Hence Proved.
(ii) Truth table of X.(Y.Z)=(X.Y).Z
| X | Y | Z | Y.Z | X.(Y.Z) | X.Y | (X.Y).Z |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 |
Both columns X.(Y.Z) and (X.Y).Z are identical.
\(\therefore\) X.(Y.Z)=(X.Y).Z Hence proved.
2.
| P | Q | R | \(\bar { Q } \) | \(\bar { Q } .R\) | \(P+\bar { Q } R\) | Maxterms |
| 0 | 0 | 0 | 1 | 0 | 0 | P+Q+R |
| 0 | 0 | 1 | 1 | 1 | 1 | P+Q+R' |
| 0 | 1 | 0 | 0 | 0 | 0 | P+Q'+R |
| 0 | 1 | 1 | 0 | 0 | 0 | P+Q'+R' |
| 1 | 0 | 0 | 1 | 0 | 1 | P'+Q+R |
| 1 | 0 | 1 | 1 | 1 | 1 | P'+Q+R' |
| 1 | 1 | 0 | 0 | 0 | 1 | P'+Q'+R |
| 1 | 1 | 1 | 0 | 0 | 1 | P'+Q'+R' |
To get the POS form we need to product maxterms for all those input combinations that produce output as 0.
Thus, \(P+\bar { Q } .R=(P+Q+R).(P+\bar { Q } +R).(P+\bar { Q } +\bar { R } )\)
3.
(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.
4.
Base address B= ?
Number of rows M = 30
Element size W = 8
ir, ic = 0
Array in column major order
Address of MAT[i][j] = B+W(J-Ic)+(I=Ir))
MAT[5][7] = 1000
1000 = B + 8[30(7-0)+(5-0)]
1000 = B + 8[30(7)+(5)]
1000 = B + 8(210+5)
1000 = B + 8(215)
1000 = B + 1720
B = 1000 - 1720
B = -720
Address of MAT[20][5]
=-720 + 8[30(5 - 0) + (20 - 0)]
| = -720 + 8[p30(5) + 20]
= -720 + 8 (150 + 20)
= -720 + 8(170)
= -720 + 1360 = 640
5.
T[i][j] = B + w[n(i-Lr)+(j-Lc)]
T[10][7] = 14000+8[10(10)+7]
= 14000+8[100+7]
= 14000+856 = 14856
6.
#include<iostream.h>
#include<stdio.h>
void main()
{
struct STUDENT
{
char stu_name[20];
char stu_sex;
int stu_age;
}student;
gets(student.stu_name);
cin>>(student.stu_sex);
}
7.
#include<iostream.h>
#include<string.h>
typedef char Text[80];
void main()
{
Text T="Indian";
int Count=strlen(T);
cout<<T<<"has"<<Count<<"characters"<<endl;
}
8.
Member functions are functions defined within class that act on data
members in the class.The use of member functions distinguishes a class from struct.Where as,an ordinary function can be called in any
function can be called only by using its object.
The member function is a member of its own class but an ordinary
function is not.
9.
Person
| Pname | Mobile Number | Address | - |
| Vikas | - | - | - |
| Harvinder | - | - | - |
| Ritesh | - | - | - |
Skills
| Skill | Code | - |
| Engineering | - | - |
| Programming | - | - |
| Operating and Engineering | - | - |
10.
#include<iostream.h>
#include<iomanip.h>
class Item
{
long IId, Qty;
public:
void Purchase( )
{
cin>>IId>>Qty;
}
void Sale( )
{
cout<<setw(5)<<IId<<"old:"<<Qty<<end1;
cout<<"New:"<<- -Qty<<end1;
}
} ;
void main( )
{
Item I;
I.Purchase( );
I.Sale( );
I.Sale( );
}
11.
A primary key is a set of one or more attributes that can uniquely identify tuples within the relation.
e.g. Table: Item
| ItemNo | Name | State | City |
| 11 | Pastry | 10 | Ajmer |
| 12 | Pizza | 15 | Delhi |
| 13 | Cake | 5 | Puna |
| 14 | Burger | 35 | Delhi |
The attribute ItemNo is a primary key in ITEM table as it contains a unique value for each tuple in a relation.
12.
Data encapsulation plays very important role in C++ because it ties data and function into a single unit so that data cannot move freely from one program to another and data cannot be accidently corrupted by the external world.It ensures that changes to the data and functions of an object can be made without affecting other objects.Objects are independent of each other.Therefore, each object can be studied properly for better understanding of the design, encapsulation links together the state and behavior of an object.
13.
Syntax error is that when statements are wrongly written violating rules of the programming language.
e.g. Max + 2 = DMax is a syntax error as an expression cannot appear on the left side of an assignment operator.
Runtime error occurs in a program during its execution. Program execution halts when such an error is encountered.
e.g. division by zero, stack overflow, etc.
14.
15.
The stack operation is:
| Scanned Elements | Operation | Stack Status |
| 10 | Push 10 | 10 |
| 40 | Push 40 | 10,40 |
| + | Pop 40,Pop10 Calculate 40+10=50 Push 50 |
50 |
| 8 | Push 8 | 50,8 |
| 2 | Push 2 | 50,8,2 |
| + | Pop 2,Pop 8 Calculate 2+8=10 Push 10 |
|
| * | Pop 10,Pop 50 Calculate 10*50=500 Push 500 |
500 |
| 10 | Push 10 | 500,10 |
| - | Pop 10,Pop 500 Calculate 500-10=490 Push 490 |
490 |
Output 490
16.
110*56*
32*26*33
17.
#include<iostream.h>
#include<conio.h>
void main()
{
int i;
for(i=1; i<10; i++)
{
cout<<i<<" ";
if(i==4)
break;
}
getch();
} //Loop exit after printing 1 through 4
Output
1 2 3 4
18.
Output
Enter the first time in hh mm ss format
12 30 55
Enter the second time in hh mm ss format
8 10 45
First time is
HOURS 12
MINUTES 30
SECONDS 55
Second time is
HOURS 8
MINUTES 10
SECONDS 45
Resultant time is
HOURS 20
MINUTES 41
SECONDS 40
19.
(i) Hierarhical inheritance
(ii) Data members:
Location, area, sale.
(iii) Member function:
Enter(), Show(), Regster(), Show().
(iv) Data member:
None
Member function:
input(), Output()
20.
struct node
{
int admno;
node *link;
};
node *push(node *top,int va1)
{
node *temp=new node;
temp->admno=va1;
temp->link=NULL;
if(top=NULL)
top=temp;
else
{
temp->link=top;
top=temp;
}
return(top);
}
21.
int countupcase()
{
ifstream fin("ARTICLE.TXT");
char ch;
int count = 0;
while(!fin.eof())
{
fin>>ch;
if(isupper(ch))
count++;
}
fin.close();
return count;
}
22.
1*1=1
1*3=3
1*5=5
2*1=2
2*3=6
2*5=10
a=32
Now k=2, b=2, c=2.666667
23.
(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.
24.
(i) Data member:
None
(ii) Member functions:
void Read_values()
void Display_values()
void Set_values()
void Show_values()
(iii) Hierarchical Inheritance.
(iv) Number of bytes required by an object of class type DECORTIVE :50 Bytes
25.
( )
| 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 } )\)
26.
( )
VoIP (voice over Internet Protocol) is simply the transmission of voice traffic over IP-based networks, VoIP has been around in one form or another, since 1973 when it began as an experiment by US.
27.
( )
DROP TABLE command deletes the definition of the table as well as the data of table.If the table is dropped you cannot access it.While DROP VIEW command only deletes the definition of view.Dropping a view does not affect the base table.i.e. no loss of data is there in DROP VIEW.
Syntax of DROP View is - DROP VIEW viewname;
28.
( )
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.
29.
( )
'I' operator used to find the quotient, whereas '%' operator used to find the remainder.
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