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: 03/03/2020
12th Standard Computer Science Board Exam Sample Question 2020
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.
Write the equivalent Boolean Expression F for the following circuit diagram :
2.
Assume a text file “Test.TXT” is already created. Using this file, create a function to create three files “LOWER.TXT” which contains all the lowercase vowels and UPPER.TXT” which contains all the uppercase vowels and “DIGIT.TXT” which contains all digits.
3.
Predict the output of the following code:
# include< iostram.h >
#include< coni.h >
void main()
{
int arr[ ] = {12, 23, 34, 45};
int *ptr = arr; int val = *ptr; cout << val << endl;
val = *ptr++; cout << val << endl;
val = *ptr; cout << val << endl;
val = *++ptr; cout << val << endl;
}
4.
Explain the following terms in short:
(i) DHTML
(ii) ISP
5.
Find the output of the following program:
#include<iostream.h>
#include<conio.h>
struct score
{
int Year;
float Topper;
};
void Change(score *s,int x=20)
{
s->Topper+(s->Topper+25)-x;
s->Year++;
}
void main()
{
clrscr();
score Arr[]={{2007,100},{2008,95}};
score*point=Arr;
Change(point,50);
cout<<Arr[0],Year<<'#'<<Arr[0].Topper<<endl;
Change(++point);
cout<<point->Year<<'#'<<point->Topper<<endl;
getch();
}
6.
Write a user defined function DispNTen(int L[][4],int R,int C) in c++ to find and display all the numbers,which are the content of array is:
e.g.if the content of array is:
| 20 | 17 | 30 |
| 12 | 19 | 10 |
The output should be
17 13 19
7.
Write a function in c++, with accept an integer array and its size as parameters and rearrange the array in reverse order.
e.g
if an array contain the elements as
4,2,5,1,6,7,8,12,10
then the function should rearrange the array as
10,12,8,7,6,1,5,2,4
8.
Obtain the output of the following c++ program, which will appear on the screen after its execution.
important Note
All the desired header files are already included in the code, which are required to run the code.
class Player
{
int Score, Level;
char Game;
public:
Player(char GGame='A')
{
Score=0;
Level=1;
Game-=GGame;
}
void Start(int SC);
void Next();
void Disp()
{
cout<<Game<<"@";
cout<<Level<<end1;
cout<<Score<<end1;
}
};
void main()
{
Player P, Q('B');
P.Disp();
Q.Disp();
Q.start(75);
Q.Next();
P.start(120);
Q.Disp();
P.Disp();
}
void Player::Next()
{
Game=(Game=='A')?'B':'A':
}
void Player::Start(int SC)
{
Score += SC;
if(Score>=100)
Level=3;
else if(Score>=50)
Level=2;
else
Level=1;
}
9.
Find the output the following program:
#include<iostream.h>
void main()
{
int First=25, sec=30;
for( int I=1; I<=2;I++)
{
cout<<"Output 1="<
cout<<"Output 2="<<--Sec<<" & "<
}
}
10.
Consider the following relations
Teach (Name, Address, Course)
Give an expression in the relational algebra for each of the following:
(i) Print all the information about teachers who are teaching the 'DBMS' course.
(ii) Print the names and addresses of those teachers who teach 'computer'.
(iii) List all the teachers who live in Mumbai.
11.
What do you understand by normalization?
12.
Differentiate between logical error and syntax error. Also, give suitable examples of each in C++.
13.
Find the output of the following program:
#include < iostram.h >
#include < string.h >
struct Game
{
char Magic[20];
int Score;
};
void main()
{
clrscr();
Game M={"Tiger", 500} ;
char *Choice ;
Choice = M.Magic;
Choice[4]='P' ;
Choice[2]='L' ;
M.Score+=50;
cout << M.Magic << M.Score << ndl;
Game N=M;
N.Score=120;
cout << N.Magic << N.Score << endl;
getch( );
}
14.
Obtain the simplified form of a Boolean Expression using Karnaugh Map F(w,x,y,z)=S(0,1,2,3,4,8,9,10,11)
15.
If F(a,b,c,d) = (0,1,3,4,5,7,8,9,11,12,13,15), obtain the simplified form using KMap
16.
Evaluate the following postfix notation of expression:
25,8,3,-,/,6,*,10,+
17.
A C++ program contains following declaration:
static int x[5]={5,20,30,50,70};
(i)what is the meaning of x?
(ii)what is the meaning of(x+2)?
(iii) what is the value of *x?
(iv) what is the value of *(x+2)?
(v) what is the value of *(x+2)?
18.
Rewrite the following program after removing the syntactical error(s), (if any). Underline each correction.
#include<iostream.h>
const int Multiple 3;
void main()
{
value = 15;
for( int Counter=1; Counter=<5; Counter++, value-=2)
if(value%Multiple==0)
cout<<Value*Multiple;
cout<<endl;
else
cout<<Value+Multiple<<endl;
}
19.
To print the numbers 0 to 10 with the help of for loop.
20.
To show the use of static function.
21.
Answer the questions (i) and (ii) after going through the following class:
class Interview
{
int month;
public:
Interview (int y) {month=y ;} //Constructor 1
Interview (Interview &t); //Constructor 2
};
(a) Create an object, such that it invokes Constructor 1
(b) Write complete definition for Constructor 2
22.
Write a function in C++ to perform a PUSH operation in a dynamically allocated stack considering the following :
Struct Node
{ int X,Y; Node *Link; };
class STACK
{ Node * Top;
Public: STACK( )
{ TOP=NULL;}
void PUSH( );
void POP( );
~STACK( );
};
23.
Write function SORTPOINTS() in c++ to sort an array of structure Game in descending order of points using Bubble Sort Note: Assume the following definition of
structure Game struct Game
{
long PNo; // Player Number
char PName[20];
long points;
};
24.
Answer the questions (i) to (iv) based on the following code :
class CUSTOMER
{ int Cust_no;
char Cust_Name[20];
protected:
void Register();
public: CUSTOMER();
void Status(); };
class SALESMAN
{
int Salesman_no;
char Salesman_Name[20];
protected: float Salary;
public: SALESMAN();
void Enter( );
void Show( );
};
class SHOP :
private CUSTOMER , public SALESMAN
{
char Voucher_No[10];
char Sales_Date[8];
public:
SHOP();
void Sales_Entry();
void Sales_Detail();
}
(iii) Write the names of data members which are accessible from objects belonging to class CUSTOMER.
(iv) Write the names of all the member functions which are accessible from objects belonging to class SALESMAN.
(v) Write the names of all the members which are accessible from member functions of class SHOP. (iv) How many bytes will be required by an object belonging to SHOP?
25.
Trine Tech Corporation (TTC) is a professional consultancy company. the company is planning to set up their offices in India with its hub at Hyderabad. As a network advisor, you have to understand their requirement and suggest them the best available solutions. Their queries are mentioned as (i) to (iv) below.
Block to block distance(in m)
| Block (From) | Block(To) | Distance |
|---|---|---|
| Human Resource | Conference | 110 |
| Human Resource | Finance | 40 |
| Conference | Finance | 80 |
Expected number of computers to be in each block
| Block | Computers |
| Human Resource | 25 |
| Finance | 120 |
| Conference | 90 |
(i) Which will be the most appropriate block, where TTC should plan to install their server?
(ii) Draw a block to block cable layout to connect all the building in the most appropriate manner for efficient communication.
(iii) What will be the best possible connectivity out of the following, you will suggest to connect the new setup of offices in Bangalore with its London based office.
(iv) Which of the following device will be suggested by you to connect each computer in each of the buildings?
26.
Write a function in C++ to search for the details(phone no and Calls) of those phons, which have more than 1000 calls from a binary file phons.dat. Assuming that this binary file contains records? objects of class phone, which is defined below.
class phone
{
char phoneno[10];
int calls;
public:
void get(){gets(phoneno);
cin>>calls;
void billing(){cout<
};
27.
Assuming the class GAMES as declard below, write a function in C++ to read the objects of GAMES from binary file GAMES.DAT and
display those details of those GAMES, which are meant for children of Age Range"8 to 13"
class GAMES
{
int Gamecode;
char GameName[10];
char *AgeRange;
public:
void Enter()
{
cin>>GameCode;
gets(GameName);
gets(AgeRange);
}
void Display()
{
cout<
char *AgeR() {return AgeRange;}
};
28.
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');
29.
Write a program in C++ to print first 10 multiples of an integer N, where N is to be entered by user:
30.
Observe the program segment given below carefully and fill the blanks marked as Statement 1 and Statement 2 using seekp() and seekg() functions for performing the required task
#include <fstream.h >
class Item
{
int Ino;char Item[20];
public:
//Function to search and display the content from a particular record number
void Search(int );
//Function to modify the content of a particular record number
void Modify(int);
};
void Item::Search(int RecNo)
{
fstream File;
File.open("STOCK.DAT",ios::binary| ios::in);
_______________//Statement 1
File.read((char*)this,sizeof(Item));
cout<
}
void Item::Modify(int RecNo)
{
fstream File;
File.open("STOCK.DAT",ios::binary|ios::in|ios::out);
cout>>Ino;
cin.getline(Item,20);
____________//Statement 2
File.write((char*)this,sizeof(Item));
File.close();
}
31.
Express \(P+\bar { Q } .R\) in canonical SOP form
32.
Why are NAND and NOR gates called Universal gates?
33.
How many input combinations can be there in the truth table of a logic system having(N) input binary variables?
34.
Write the dual of the boolean expression \((A+0).(A.1.\bar { A } )\)
35.
Write the Sum of Product(SOP) form of the function F(A,B,C) for the following truth table representation of F:
| A | B | C | F |
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 |
36.
Distinguish between websites and web browser.
37.
Give one suitable example of each URL and domain name.
38.
Create a table named PROGRAMMERS with the following structure:
| P_Name | 20 Characters |
| DOJ | Date |
| SAL | NUMBER |
i) Display the name of the programmer, which has the highest salary.
ii) Update the salary of all programmer by 2000 whose name start with letter 'R'.
39.
Write a query on the SALESPEOPLE table, whose output will exclude all salespeople with a rating >=100, unless they are located in Delhi.
40.
Give the SQL statement to create a table STUDENT with Roll Number, Name, Age and Marks.
41.
Differentiate between SQL commands DROP TABLE and DROP VIEW.
42.
What are DDL and DML?
43.
What is protocol? Which protocol is used to copy a file from/to a remote server?
44.
What are repeaters?
45.
Write one advantage of star topology of network? Also, illustrate how five computers can be connected with each other using star topology of ntework
46.
What are nested structures? Give an example.
47.
How wil you know that a linear queue is full?
48.
Suppose a data structure is stored in a circular queue with N memory locations what will be the queue full condition?
49.
When will you make a function inline?
50.
How many times is the loop executed?
int i=0, j=0;
do
{
i=j;
}
while(j<5);
51.
How is an entry controlled loop different from exit controlled loop?
52.
How does a compiler decide as to which function should be invoked when there are many functions with the same name?
53.
To relate with real world,if book is a class then give example of its objects.
54.
Inheritance allows code reusability in OOp.Explain how?
55.
Is this possible to declare two functions with same name and same argument but different return type in C++?
56.
Write the difference between = and ==
57.
Write SQL commands for (a) to (g) on the basis of the table SPORTS
TABLE: SPORTS
| STUDENTNO | CLASS | NAME | GAME1 | GRADE | GAME2 | GRADE1 |
| 10 | 7 | Sameer | Cricket | B | Swimming | A |
| 11 | 8 | Sujit | Tennis | A | Skating | C |
| 12 | 7 | Kamal | Swimming | B | Football | B |
| 13 | 7 | Veena | Tennis | C | Tennis | A |
| 14 | 9 | Archana | Basketball | A | Cricket | A |
| 15 | 10 | Arpit | Cricket | A | Atheletics | C |
(a) Display the names of the students, who have grade 'C' in either GAME1 or GAME2 or both.
(b) Display the number of students getting grade'A' in cricket.
(c) Display the names of the students who have same game for both GAME1 and GAME2.
(d) Display the games taken up by the students, whose name starts with 'A'.
(e) Add a new column names MARKS.
(f) Assign a value 200 for Marks for all those who are getting grade 'B' or grade 'A' in both GAME1 and GAME2.
(g) arrange the whole table in the alphabetical order of NAME.
58.
Write SQL commands for (a) to(f) and write the outputs for (g) parts(i) to(iii) on the basis of table INTERIORS.
TABLE: INTERIORS
| No | ITEMNAME | TYPE | DATEOFSTOCK | PRICE | DISCOUNT |
| 1 | Red rose | Double Bed | 23/02/02 | 32000 | 15 |
| 2 | Soft touch | Baby cot | 20/01/02 | 9000 | 10 |
| 3 | jerry's home | Baby cot | 19/02/02 | 8500 | 10 |
| 4 | Rough wood | Office Table | 01/01/02 | 20000 | 20 |
| 5 | Comfort zone | Double Bed | 12/01/02 | 15000 | 20 |
| 6 | Jerry look | Baby cot | 24/02/02 | 7000 | 19 |
| 7 | Lion king | Office Table | 20/02/02 | 16000 | 20 |
| 8 | Royal tiger | Sofa | 22/02/02 | 30000 | 25 |
| 9 | Park sitting | Sofa | 13/12/01 | 9000 | 15 |
| 10 | Dine Paradise | Dining Table | 19/02/02 | 11000 | 15 |
| 11 | White Wood | Double Bed | 23/02/03 | 20000 | 20 |
| 12 | James 007 | Sofa | 20/02/03 | 15000 | 15 |
| 13 | Tomlook | Baby cot | 21/02/03 | 7000 | 10 |
(a) To show all information about the Sofa from the ITERIORS table.
(b) Tolist the ITEMNAME, which are picked at more than 10000 from the INTERIORS table.
(c) Tolist ITEMNAME and TYPE of those oitems, in which DATEOFSTOCK is before 22/01/02 from the INTERIORS TABLE IN DESCENING ORDER OF itemname.
(d) To display ITEMNAME and DATEOF STOCK of those items, in which the discount percentage is more than 15 from INTERIORS table.
(e) To count the number of items, whose type is Double Bed from INTERIORS table.
(f) To insert a new row in the INTERIORS table with the following data
{14,'True Indian','Office Table','28/03/03',15000,20}
(g) Give the output of following SQL statements:
(i) SELECT COUNT(DISTINCT TYPE) FROM INTERIORS;
(ii) SELECT AVG(DISCOUNT) FROM INTERIORS WHERE TYPE='Babycot';
(iii) SELECT SUM(PRICE) FROM INTERIORS WHERE DATEOFSTOCK<'12/02/02';
OUTPUTS OF THE BELOW MENTIONED QUERIES SHOULD BE BASED ON ORIGINAL DATA GIVEN IN THE TABLES I.E. WITHOUT CONSIDERING THE INSERTION DONE IN (vi) PART OF THIS QUESTION.
59.
Write the SQL commands for (a) to (f) and write the outputs for SQL queries (g) parts(i) to (iv) on the basis of the table HOSPITAL
TABLE: HOSPITAL
| No | Name | Age | Description | Dateofadm | Charges | Sex |
| 1 | Sandeep | 65 | Surgery | 23/02/98 | 300 | M |
| 2 | Ravin | 24 | Orthopaedic | 20/01/98 | 200 | F |
| 3 | Karan | 45 | Orthopaedic | 19/02/98 | 200 | M |
| 4 | Tarun | 12 | Surgery | 01/01/98 | 300 | M |
| 5 | Zubin | 36 | ENT | 12/01/98 | 250 | M |
| 6 | Ketaki | 16 | ENT | 24/02/98 | 300 | F |
| 7 | Ankita | 29 | Cardiology | 20/02/98 | 800 | F |
| 8 | Zareen | 45 | Gynaecology | 22/02/98 | 300 | F |
| 9 | Kush | 19 | Cardiology | 13/01/98 | 800 | M |
| 10 | Shailya | 31 | Nuclear Medicine | 19/02/98 | 400 | M |
(a) To show all information about the patients of Cardiology Department.
(b) To list the name of female patients, who are in Orthopaedic Department.
(c) To list names of all patients with their date of admission in ascending order.
(d) To display Patient's Name,Charge, Age for male patients only.
(e) To count the number of patients with age>20.
(f) To insert a new row in the hospital table with the following data:
{11,'Mustafa',37,'ENT','25/02/98',250,'M'}
(g) Give the output of following SQL statements
(i) SELECT COUNT(DISTINCT Charges) FROM HOSP[ITAL;
(ii) SELECT MIN(Age) FROM HOSPITAL WHERE Sex='M';
(iii) SELECT SUM(Charges) FROM HOSPITAL WHERE Sex='F';
(iv) SELECT AVG(Charges) FROM HOSPITAL WHERE DaTEofadm<'12/02/98';
60.
Consider the following tables.Write SQL commands for the statements (a) to (d) and give outputs for SQL queries (e) to (h)
TABLE: SENDER
| SENDER ID | Sender Name | Sender Address | SenderCity |
| ND01 | R Jain | 2, ABC Appts | New Delhi |
| MU02 | H sinha | 12,Newtown | Mumbai |
| MU15 | SJha | 27/A,Park Street | Mumbai |
| ND50 | T Prasad | 122-k,SDA | New Delhi |
TABLE:RECEIPIENT
| RecID | SenderID | RecName | RecAddress | RecCity |
| KO05 | ND01 | R Baipayee | 5,Central Avenue | Kolkata |
| ND08 | MU02 | S Mahajan | 116, A Vihar | New Delhi |
| MU19 | ND01 | HSingh | 2A,Andheri East | Mumbai |
| MU32 | MU15 | P k Swamy | B5, C S Terminus | Mumbai |
| ND48 | ND50 | S Tripathi | 13,B1 D,Mayur Vihar | New Delhi |
(a) To display the names of all Sender from Mumbai.
(b) To display the RecID, Sender Name, Sender Address, Rec Name, Rec Address for every Recipient.
(c) To display Recipient details in ascending order of RecName.
(d) To display number of Recipients from each city.
(e) SELECT DISTINCT SenderCity FROM SENDER;
(f) SELECT A.SenderName, B.Recname FROM SENDER A, RECIPIENT B
WHERE A.Sender ID=B.SenderID AND B>RecCity='Mumbai';
(g) SELECT Recname, RecAddress FROM RECIPIENT
WHERE RecCity NOT IN('Mumbai','Kolkata');
(h) SELECT RecID, RecNam FROM RECIPIENT
WHERE SenderID='MU02' OR SenderID='ND50';
61.
Write SQL queries for (a) to (f) and write the outputs for (g) parts (i) to (iv) on the basis of tables APPLICANTS and COURSES.
TABLE: APPLICANTS
| No | NAME | FEE | GENDER | C_ID | JOINYEAR |
| 1012 | Amandeep | 30000 | M | A01 | 2012 |
| 1102 | Avisha | 25000 | F | A02 | 2009 |
| 1103 | Ekant | 30000 | M | A02 | 2011 |
| 1049 | Arun | 30000 | M | A03 | 2009 |
| 1025 | Amber | 40000 | M | A02 | 2011 |
| 1106 | Ela | 40000 | F | A05 | 2010 |
| 1017 | Nikita | 35000 | F | A03 | 2012 |
| 1108 | Arluna | 30000 | F | A03 | 2012 |
| 2109 | Shakti | 35000 | M | A04 | 2011 |
| 1101 | Kirat | 25000 | M | A01 | 2012 |
TABLE: COURSES
| C_ID | COURSES |
| A01 | FASHION DESIGN |
| A02 | NETWORKING |
| A03 | HOTEL MANAGEMENT |
| A04 | EVENT MANAGEMENT |
| A05 | OFFICE MANAGEMENT |
(a) To display NAME, FEE, Gender, JOINYEAR about the APPLICANTS, who have joined
before 2010.
(b) To display the names of applicants, who are paying FEE more than 30000.
(c) To display the names of all applicants in ascending order of their joinyear.
(d) To display the year and the total number of applicants joined in each year
from the table APPLICANTS>
(e) To display the C_ID and the number of applicants registered in the course
from the APPLICANTS table.
(f) To display the applicant's name with their respective course's name from the
tables APPLICANTS and COURSES.
(g) Give the output of the following SQL statements:
(i) SELECT NAME,JOINYEAR FROM APPLICANTS WHERE GENDER='F' AND C_ID='A02';
(ii) SELECT MIN(JOINYEAR) FROM APPLICANTS WHERE GENDER='M';
(iii) SELECT AVG(FEE) FROM APPLICANTS WHERE C_ID='A01' OR C_ID='A05';
(iv) SELECT SUM(FEE), C_ID FROM APPLICANTS GROUP BY C_ID HAVING COUNT(*)=2;
1.
X’(Y’+Z)
2.
3.
int arr[ ] = {12, 23, 34, 45};
int *ptr = arr;
int val = *ptr; cout << val << endl;
val = *ptr++; cout << val << endl; // first print value then increment the address(post // increment in value)
val = *ptr; cout << val << endl; // only values are changing
val = *++ptr; cout << val << endl; // first increment the address and then print the value.
}
4.
(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.
5.
Output
2008#75
2009#100
6.
void DispNTen(int L[][4],int R,int C)
{
int i,j;
for(i=0;i<R;i++)
for (j=0;j<c;j++)
if (L[i][j] != 0)
cout<<L[i][j]<<" ";
}
7.
void RevArray(int A[],int size)
{
int i=0, j=ize-1,temp;
for(; i<=j; i++,j--)
{
temp = A[i];
A[i] = A[j];
A{j} = temp;
}
}
8.
A@1
0
A@2
75
A@3
120
9.
Output 1=25&35
Output 2=29&21
Output 1=26&34
Output 2=28&22
10.
\((i){ \sigma }_{ Course="DBMS" }(Teach)\\ (ii){ \Pi }_{ Name,Address }({ \sigma }_{ Course="Computer" })(Teach)\\ (iii){ \sigma }_{ Address="Mumbai" }(Teach)\)
11.
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.
12.
Logical error Wrong logic in the program cause a program to produce undesired output or no output. Such kind of errors are called logical errors. These errors depend on the logical explanation and are easy to detect, if we follow the line of execution and determine why the program takes that path of execution.
e.g. if in place of
\(a+\frac { b }{ 2 } \), by mistake, \(a*\frac { b }{ 2 } \) is written, it will be a logical error.
Syntax error A syntax error is the error that occurs when rules of C++ language are violated in the program
e.g. in statement
cout<<"hello",
\(\therefore \) statement(;) missing is a syntax error.
13.
14.
15.
16.
| scanned elements | Operations | Stack Status |
| 25 | Push | 25 |
| 8 | Push | 25,8 |
| 3 | Push | 25,8,3 |
| - | Pop twice 8-3=5 Push |
25,5 |
| / | Pop twice 25/5=5 Push |
5 |
| 6 | Push | 5,6 |
| * | Pop twice 5*6=30 Push |
30 |
| 10 | Push | 30,10 |
| + | Pop twice 30+10=40 Push |
40 |
Output 40
17.
Let us assume the bae adress or the starting adress of the array as
1000,i.e
x
| 5 | 20 | 30 | 50 | 70 |
1000 1002 1004 1006 1008
Here,each box is taking 2 bytes because array contains integer type varaiables and int takes 2 bytes.
(i) x represents an array of size 5 and also the base adress of array, i.e 1000.
(ii) It will increase the value of x 4 bytes,because
x+2=x+(size of unit)*2=1000+2*2=1004
(iii)*x means value at the adress contained in x[0],i.e.5.
(iv) (*x+2)=*(1000)+2
[because *(dereference operator) has higher priority than binary operators]
(v)*(x+2)=*(1000+2*2)=*(1004)=30
18.
#include<iostream.h>
const int Multiple =3; //Correction 1
void main()
{
int value = 15; //Correction 2
for( int Counter=1; Counter<=5; Counter++, value-=2) //Correction 3
if(value%Multiple==0)
{
cout<<Value*Multiple;
cout<<endl;
} //correction 4 else
cout<<Value+Multiple<<endl;
}
Correction 1 Multiple must be assigned a value.
Correction 2 Variable value must be declared with datatype.
Correction 3 =< Must be replace with <=.
Correction 4 Misplace else; so after if, compound statement must be enclosed with { }.
19.
#include
#include
void main()
{
int count;
for(count=0; count<11; count++)
cout<
getch();
}
Output
0 1 2 3 4 5 6 7 8 9 10
It is divided into three parts
| Expression | Name | Purpose |
|---|---|---|
| count=0 | Initialise expression | Initialises loop variable |
| count<11 | Test expression | Test loop variable |
| count++ | Increment expression | increment loop variable |
20.
#include<iostream.h>
#include<conio.h>
class test
{
int code;
static int count;
public :
void setccode(void)
{
code = ++count;
}
void showcode(void)
{
cout<<"object number ";
cout<<code<<end1;
}
static void showcount(void)
{
cout<<"count "<<count<<end1;
}
} ;
int test :: count;
void main()
{
test t1, t2;
t1.setcode();
t2.setcode();
test :: showcount();
//accessing static function
test t3;
t3.setcode();
test :: showcount();
t1.showcode();
t2.showcode();
t3.showcode();
getch();
}
Output
count 2
count 3
object number 1
object number 2
onject number 3
21.
22.
23.
You know bubble sort, in which we are using simple array. Here you are asked to sort structure array base on the element points. If in the normal array say x[10] , you are using x[i], here in the structure array say gm[10], you have to use gm[i].points because you are sorting based on the variable points in the structure Game
void SORTPOINTS()
{
Game gm[10];
Game temp;
Cout << "Enter the details of 10 games" << end1;
For(inti=0;i++)
{
Cout >> gm[i].PNo;
Gets(gm[i].PName);
Cin >>gm[i].points;
}
// Use the logic for bubble sort.
/*Points to note in bubble sort
1. Compare with the adjacent elements ie j and j+1
2. Bigger element goes to the top because the elements in the descending order.
3. Each iteration the smaller elements comes in the bottom.*/
for(i=0;i <n;i++)
{
for(j=0;j <(n-1)-i;j++) // j< (N-1)-i, subtracting i to avoid the
// last elements which are in the correct order
// after each loop execution
{
If(gm[j].points < gm[j+].points)
{
temp=gm[j];
gm[j]=gm[j+1]
gm[j+1]=temp;
}
}
}
24.
(i) None of data members are accessible from objects belonging to class AUTHOR.
(ii) Enter(), Show()
(iii) Data members: Voucher_No, Sales_Date, Salary Member function:Sales_Entry(),Sales_Detail(),Enter(),Show(),Register(), Status()
(iv) 66
25.
(i) TTC should install its server in finance block as it is having a maximum number of computers.
(ii) The above layout is based on maximum cable length required, which is 120 meters in the above case.
(iii) Satellite Link
(iv) Switch.
26.
void show()
{
ifstream fcin("phones.dat",ios::in ios::binary);
phone P;
while(fcin.read((char*)&p,sizeof(p)))
{
if(P.getCalls()>1000)
{
P.billing();
}
}
fcin.close();
}
27.
void READGAMES()
{
GAMES obj;
ifstream infile(:GAMES.DAT:);
while(infile.read((char*)&obj,sizeof(obj)))
{
if(strcmp(obj.Agr(),"8 to 13")==0)
obj.Display();
}
infile.close();
}
28.
(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.
29.
#include
#include
void main()
{
int n, i;
clrscr();
cout<<"Enter the number to find the multiple";
cin>>n;
for(i=1;i<=10;i++)
cout< getch();
}
30.
( )
File.seekg(RecNo*sizeof(Item)); //Statement 1
File.seekp(RecNo*sizeof(Item)); //Statement 2
31.
( )
\(\Longrightarrow P+\bar { Q } .R\)
\(\Longrightarrow P.(Q+\bar { Q } ).(R+\bar { R } )+(P+\bar { P } ).\bar { Q } .R\)
\(\Longrightarrow (P.Q+P.\bar { Q } ).(R+\bar { R } )+P.\bar { Q } .R+\bar { P } .\bar { Q } .R\)
\(\Longrightarrow R.(P.Q+P.\bar { Q } ).\bar { R } .(P.Q+P.\bar { Q } )+P.\bar { Q } .R+\bar { P } .\bar { Q } .R\)
\(\Longrightarrow P.Q.R+P.\bar { Q } .R+P.Q.\bar { R } +P.\bar { Q } .\bar { R } +P.\bar { Q } .R+\bar { P } .\bar { Q } .R\)
Now, remove duplicate term,
\(\Longrightarrow P.Q.R+P.\bar { Q } .R+P.Q.\bar { R } +P.\bar { Q } .\bar { R } +\bar { P } .\bar { Q } .R\)
32.
( )
NAND and NOR gates are easier to design and basic functions like AND, OR and NOT, etc., can be easily implemented using NAND/NOR gates. So, these gates are called Universal gates.
33.
( )
2N input combinations can be there in the truth table of a logic system.
34.
( )
Using duality principle, changing (+) to (.) and vice-versa and by replacing 0's with 1's and 1's with 0's, the dual for the given expression is as follows:\((A.1)+(A+0+\bar { A } )\)
35.
( )
| A | B | C | F | Minterms |
| 0 | 0 | 0 | 0 | \(\bar{A}.\bar { B } .\bar { C }\) |
| 0 | 0 | 1 | 0 | \(\bar{A}.\bar { B } .C\) |
| 0 | 1 | 0 | 1 | \(\bar { A } .B.\bar { C }\) |
| 0 | 1 | 1 | 1 | \(\bar { A } .B.C\) |
| 1 | 0 | 0 | 1 | \(A.\bar { B } .\bar { C }\) |
| 1 | 0 | 1 | 0 | \(A.\bar { B } .C\) |
| 1 | 1 | 0 | 0 | \(A.B .\bar { C }\) |
| 1 | 1 | 1 | 1 | A.B.C |
SOP form of function F(A, B, C) is: \(\bar { A } .B.\bar { C } +\bar { A } .B.C+A.\bar { B } .\bar { C } +A.B.C\)
36.
( )
Website It is a place on the net servers to keep web pages.
Web Browsers It is a software application for retrieving, presenting and traversing information resources on the World Wide Web.
37.
( )
URL http://www.Gabsclasses.com/aboutus
Domain name www.Gabsclasses.com
38.
( )
i)Select P_Name MAX(SAL) FROM PROGRAMMERS;
ii)UPDATE PROGRAMMERS SET SAL=SAL+2000 WHERE P_NAME LIKE "R%';
39.
( )
SELECT * FROM SALESPEOPLE
WHERE rating<100 or city='Delhi';
SELECT*FROM SALESPEOPLE WHERE NOT rating>=100 OR city ='Delhi';
SELECT*FROM SALESPEOPLE WHERE NOT(rating>=100 AND city<>'Delhi');
40.
( )
CREATE TABLE STUDENT( ROLL Number NUMBER(5) Primary key, Name CHAR(20), Age NUMBER(2), MARKS NUMBER(4));
41.
( )
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;
42.
( )
DDL (Data Definition Language) It is a part of SQL, which provides commands for creation,altering and deleting the tables.Different DDL commands are CREATE, ALTER and DROP.
DML (Data Manipulation language) It is a part of SQL, which provides commands for inserting, deleting and updating the information in a database.Different DML commands are SELECT,UPDATE,DELETE,INSERT.
43.
( )
Protocol is a set of rules that two or more computers must follow to communicate on network.
FTP (File transfer Protocol) is used to copy a file from/to a transfer located server.
44.
( )
Repeaters are electronic devices, that receive a signal and retransmit it at a higher level so that the signal covers longer distance. It's required if the distance between source and destination is 90 m or more
45.
( )
Advantage of star topology No distribution to the network when connecting or removing devices.
Five computers can be connected with each other using server in the following way:
46.
( )
A structure declared within another structure is called nested structure.
e.g.
struct Record
{
int rollno;
struct student
{
char fn[10];
char mn[10];
char ln[10];
};
char st_class;
char section;
};
47.
( )
In a linear queue,if Rear is equal to maximum size then queue is full.
48.
( )
Circular queue will be full if ((front==Rear + 1) (Fornt == 0 && Rear ==N-1))
49.
( )
When the size of the code of a function is so small, that the overhead of the function call becomes prominent then the function should be declared as inline.
50.
( )
Infinite loop because the value of i and j is always equal to zero.
51.
( )
In an entry controlled loop, the condition is evaluated at the entry point of the loop, e.g. for and while loop. while is an exit controlled loop, the condition is evaluated at the exit point of the loop, e.g. do-while loop.
52.
( )
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.
53.
( )
If 'book' is a class then the objects of this class are Hindi,English,Social science,Computer science,etc.
54.
( )
Inheritance allows us to add additional features to an existing class without modifying it.Thus,
the class can be raised by inheriting it.We look for a class that can be reused in our program.
If such a class exists,we simple use it or inherit it.Thus , inheritance allows code reusability.
55.
( )
No,it is not possible to declare two functions with same name and same argument but different
return type in C++,because the control will be confused at the time of calling which of these function will be executed first.
56.
( )
= is a assignment operator, which assign a value while == is a relational operator, which test the equality.
57.
(a) SELECT NAME FROM SPORTS WHERE GRADE ='C' OR GRADE1='C';
(b) SELECT COUNT (*) FROM SPORTS
WHERE (GAME1='CRICKET' AND GRADE='A') OR (GAME2='CRICKET'AND GRADE1='A');
(c) SELECT NAME FROM SPORTS WHERE GAME1=GAME2;
(d) SELECT GAME1, GAME2 FROM SPORTS WHERE NAME LIKE 'A%';
(e) ALTER TABLE SPORTS ADD(MARKS NUMBER(3));
(f) UPDATE SPORTS SET MARKS=200
WHERE GRADE ='A' OR GRADE='B' OR GRADE1='A' OR GRADE1='B';
(g) SELECT * FROM SPORTS ORDER BY NAME;
58.
(a) SELECT * FROM INTERIORS WHERE TYPE='Sofa';
(b) SELECT ITEMNAME FROM INTERIORS WHERE PRICE>10000;
(c) SELECT ITEMNAME, TYPE FROM INTERIORS WHERE DATAOFSTOCK<'22/01/02' ORDER BY ITEMNAME DESC;
(d) SELECT ITEMNAME, DATEOFSTOCK FROM INTERIORS WHERE DISCOUNT>15;
(e) SELECT COUNT(*) FROM INTERIORS WHERE TYPE='Double Bed';
(f) INSERT INTO INTERIORS VALUES(14,''TrueIndian','Office Table','28/03/03',15000,20);
(g) The output is given after excluding the row given in -part(f)
(i)
| COUNT(DISTINCT TYPE) |
| 5 |
(ii)
| AVG(DISCOUNT) |
| 12.25 |
(iii)
| SUM(PRICE) |
| 53000 |
59.
(a) SELECT * FROM HOSPITAL WHERE Department='Cardiology';
(b) SELECT NAME FROM HOSPITAL WHERE Department='oRTHOPAEDIC' AND Sex='F';
(c) SELECT NAME FROM HOSPITAL ORDER BY Dateofadm;
(d) SELECT Name, Charges< Age FROM HOSPITAL WHERE Sex='M';
(e) SELECT COUNT(*) FROM HOSPITAL WHERE Age>20;
(f) INSERT INTO HOSPITAL VALUES(11,'Mustafa',37,'ENT','25/02/98',250,'M');
(g) The output is given after excluding the row given in part(f).
(i)
| COUNT(DISTINCT Carges) |
| 5 |
(ii)
| MIN(Age) |
| 12 |
(iii)
| SUM(Charges) |
| 1600 |
(iv)
| AVG(Charge) |
| 387.50 |
60.
(a) SELECT SenderName FROM SENDER WHERE SenderCity='Mumbai';
(b) SELECT RecID, SenderName, SenderAddress,RecName,RecAddress
FROM RECIPIENT, SENDER WHERE RECIPIENT.SenderID=SENDER.SenderID;
(C) SELECT*FROM RECIPIENT ORDER BY RecName;
(d) SELECT COUNT(*) As "No of Recipients",RecCity FROM RECIPIENT GROUP BY RecCity;
(e)
| Distinct SenderCity |
| New Delhi |
| Mumbai |
(f)
| Sendername | Recname |
| R jain | H Singh |
| S Jha | P K Swamy |
(g)
| RecName | RecAddress |
| S Mahajan | 116,A Vihar |
| S Tripathi | 13,B1D, Mayur Vihar |
(h)
| RecID | Recname |
| ND08 | S Mahajan |
| ND48 | S Tripathi |
61.
a) SELECT NAME, FEE, GENDER, JOINYEAR FROM APPLICANTS WHERE JOINYEAR<2010;
(b) SELECT NAME FROM APPLICANTS WHERE FEE>30000;
(c) SELECT NAME FROM APPLICANTS ORDER BY JOINYEAR;
(d) SELECT JOINYEAR, COUNT(*) FROM APPLICANTS GROUP BY JOINYEAR;
(e) SELECT C_ID, COUNT(*) FROM APPLICANTS GROUP BY C_ID;
(f) SELECT NAME, COURSE FROM APPLICANTS, COURSES WHERE APPLICANTS.C_ID=COURSES.C_ID;
(g) (i)
| NAME | JOINYEAR |
| Avisha | 2009 |
(ii)
| MIN(JOIN YEAR) |
| 2009 |
(iii)
| AVG(FEE) |
| 31666.666 |
(iv)
| SUM(FEE) | C_ID |
| 55000 | A01 |
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