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 CBSE Computer Science Public Exam Important Question 2019-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.
Convert the following Boolean expression into its equivalent Canonical Sum of Product Form((SOP) (X’+Y+Z’).(X’+Y+Z).(X’+Y’+Z).(X’+Y’+Z’)
3.
Assume that a text file named text1.txt already contains some text written into it, write a function named vowelwords(), that reads the file text1.txt and create a new file named text2.txt, which shall contain only those words from the file text1.txt which don’t start with an uppercase vowel(i.e., with ‘A’,’E’,’I’,’O’,’U’). for example if the file text1.txt contains: Take One Apple And one glass milk daily. Then the file text2.txt shall contain : Take one glass milk daily.
4.
Explain the following terms in short:
(i) DHTML
(ii) ISP
5.
Define a function in c++, which accepts a two dimensional array of integer and its size as argument and displays the element of middle row and the element of middle column.
e.g.
if the two dimensional array contains:
| 5 | 4 | 3 |
| 6 | 7 | 8 |
| 1 | 3 | 9 |
Output
Middle row: 6 7 8
Middle column: 4 7 2
6.
Write a Get1From2() function in c++ to transfer the content from two array FIRST[] and SECOND[] to array ALL[].the even places(0,2,4...) of array ALL[] should get the content from the array First[] and odd places (1,3,5,...) of the array ALL[] should get the content from the array SECOND[].
e.g if the FIRST[]array contain
30,60,90
and the SECOND[] array contains
10,50,80
The ALL[] array should contain
30,10,60,50,90,80
7.
Rewrite the following program after removing the syntactical errors if any.Underline each correction.
#include<iostream.h>
void main()
{
First=10,Second=20;
Jumpto(First;Second);
Jumpto(Second);
}
void Jumpto(int N!,int N2=20)
{
N1=N1+N2;
cout<<N1>>N2;
}
8.
Find out the expected correct output from the options (i) to (iv) for the following C++ code.Also find out the minimum and the maximum value that can be assigned to the variable stop used in the code.
void main()
{
int Begin=3,stop;
for(int Run=1;Run<4;Run++)
{
stop=random(Begin)+6;
cout<<Begin++<<stop<<"*";
}
}
i) 36*46*59* ii) 37*46*56* iii) 37*48*57* iv) 35*45*57*
9.
Find The output of the following program:
# include
class METRO
{
int Mno , TripNo , PassengerCount;
public:
METRO (int Tmno = 1)
{
Mno = Tmno;
TripNo=0;
PassengerCount = 0;
void Trip (int PC=20)
{
TripNo++;
PassengerCount += PC;
}
void StatusShow ( )
{
count<<Mno<<<<":"<<TripNo<<":"<<Passengercount<<end1;
};
void main ( )
{
METRO M (5) , T;
M. Trip ( );
T. Trip (50);
M. StatusShow ( );
M. Trip (30) ;
T. StatusShow ( );
M. StatusShow ( );
10.
Find the output of the following program:
#include<iostream.h>
void main()
{
int A=5,B=10;
for( int I=1; I<=2;I++)
{
cout<<"Line 1="<<A++<<"&"<<B-2<<endl;
cout<<"Line 2="<<++B<<"&"<<A+3<<endl;
}
}
11.
What is the need of normalization?
12.
What do you understand by primary key? Give a suitable example of the primary key from a table containing some meaningful data.
13.
What will be the output of the following program?
int area (int s)
{
return (s*s);
}
float area (int b, int h)
{
return (0.5*b*h);
}
void main()
{
cout< cout< cout< getch();
}
14.
Give the logic function F=AB+A’B’+A’B. Assuming the complements are available. Simplify the function using De Morgan’s Theorem. Synthesize F by using NOR gates only.
15.
Given the logic function F = xyz + yz’w + x’yz. Minimize it using K- Map.
16.
Write a function in C++ to add a new object in a binary file “Customer.dat”. assume the binary file is containing the objects of the following class: class customer
{
int CNo; Char CName[21];
public:
void Enterdata( )
{cin>>CNo.;gets(CName);} v
oid dispdata( )
{ cout<< CNo.<<CName;}
};
17.
Find the output of the following program:
#include< iostream.h >
void main( )
{
long NUM=1234543;
int F=0,S=0;
do
{
int R=NUM % 10;
f (R %2 != 0)
F += R;
else S += R;
NUM / = 10;
}
while (NUM>0);
cout<< F-s
}
18.
Evaluate the following postfix notation of expression:
20,10,+,5,2,*,-,10,/
19.
To print the numbers from 1 to 10 with the help of while loop
20.
To know the use of if-else statement.
21.
An array ARR[10][20] is stored in the memory with each element occupying 2 bytes of space. Assuming the base address of ARR to be 800,compute the address of ARR[9][11], when the array is stored as :
i) Row wise ii) Column wise
22.
An array ARR[15][20] is stored in the memory, along the row with each element occupying 4 bytes . Find out the base address and the address of the element ARR[3][2] if the element ARR[5][2] is stored at the address 1500.
23.
Answer the questions (i) to (iv) based on following code:
class World
{
int H;
protected int s;
public:
void INPUT(int);
void OUTPUT( );
};
class Country :
private World
{
int T;
protected:
int U;
public :
void INDATA(int, int);
void OUTDATA();
};
class State :
Public Country
{
int M; public :
void DISPLAY(void);
};
(i) Name the base class and derived class of the class Country.
(ii) Name the data member that can be accessed from function DISPLAY( )
(iii) Name the member functions, which can be accessed from the objects of class State.
(iv) Is the member function OUTPUT() accessible by the objects of the class Country ?
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.
Write the function in C++ to read the content of a text file PLACES.TXT and display all those lines on screen,which are either starting with'P' or starting with'S'
28.
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();
}
29.
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)
30.
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');
31.
Observe the program segment given below carefully and fill the blanks marked as Statement 1 and Statement 2 using seekg() and tellg() functions for performing the required task
#include
class Employee
{
int Eno;char Ename[20];
public:
//Function to count the total number of records
int Countrec();
};
int Item::Countrec()
{
fstream File;
File.open("EMP.DAT",ios::binary|ios::in);
______________________ ///Statement 1- To take the file pointer to
//the end of file.
int Bytes =
______________________ //Statement 2-To return total number of bytes from the beginning of file to the file pointer.
int Count = Bytes / sizeof(Item);
File.close();
return Count;
}
32.
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();
}
33.
Why are NAND and NOR gates called Universal gates?
34.
State the distributive laws of boolean algebra. How do they differ from the distributive laws of ordinary algebra?
35.
Find the complement of the following boolean function \({ F }_{ 1 }=A.B+\bar { C } .\bar { D } \) :
36.
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 |
37.
Write the Sum of Product(SOP) form of the function F(P,Q, R) for the following truth table representation of F:
| P | Q | R | 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 |
38.
Name any two common web browsers.
39.
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'.
40.
Write a query on the SALESPEOPLE table, whose output will exclude all salespeople with a rating >=100, unless they are located in Delhi.
41.
Give the SQL statement to create a table STUDENT with Roll Number, Name, Age and Marks.
42.
Differentiate between SQL commands DROP TABLE and DROP VIEW.
43.
What are DDL and DML?
44.
Name any two components required for networking.
45.
What is the function modem?
46.
In the networking, what is WAN? How is it different from LAN?
47.
Write one advantage of star topology of network? Also, illustrate how five computers can be connected with each other using star topology of ntework
48.
Suppose a data structure is stored in a circular queue with N memory locations what will be the queue full condition?
49.
An array circular queue[10] of integers exixt,where currently
Rear=0, Front=1
Answer the following questions based on the above given data:
(i) How many values arte there in queue?
(ii) If five valuesare deleted,whatwould be the new value of Front?
50.
What is the effect of absence of break in switch-case statement?
51.
How does a compiler decide as to which function should be invoked when there are many functions with the same name?
52.
Write declaration for two overloadded functions named bar().They both return float type.the first takes one argument of type char and second takes two argument of type char.If this impossible,explain why?
53.
Show two different ways to declare as integer variable named intname and set its value to 15.
54.
How are abstraction and encapulation interrelated?
55.
Differentiate between an identifier and keywords.
56.
What is wrong with the following C++ statement?
long float y;
57.
Evaluate the following C++ expressions, where a,b and c are integers and d,f are floating point numbers. The values are: a=5,b=3 and d=1.5
i) c=a-(b++)*(--d)
ii)f=(++b)*b-a
58.
Study the following tables FLIGHTS and FARES and Write SQL commands for the questions (a) to (d) and give outputs for SQL queries (e) and (f)
TABLE: FLIGHTS
| FL_NO | STARTING | ENDING | NO_FLIGHT | NO_STOPS |
| IC301 | MUMBAI | DELHI | 8 | 0 |
| IC799 | BENGALURU | DELHI | 2 | 1 |
| MC101 | INDORE | MUMBAI | 3 | 0 |
| IC302 | DELHI | MUMBAI | 8 | 0 |
| AM812 | KANPUR | BENGALURU | 3 | 1 |
| IC899 | MUMBAI | KOCHI | 1 | 4 |
| AM501 | DELHI | TRIVANDRUM | 1 | 5 |
| MU499 | MUMBAI | MADRAS | 3 | 3 |
| IC701 | DELHI | AHMEDABAD | 4 | 0 |
TABLE: FARES
| FL_NO | AIRLINES | FARE | TAX% |
| IC701 | INDIAN AIRLINES | 6500 | 10 |
| MU499 | SAHARA | 9400 | 5 |
| AM501 | JET AIRWAYS | 13450 | 8 |
| IC899 | INDIAN AIRLINES | 8300 | 4 |
| IC302 | INDIAN AIRLINES | 4300 | 10 |
| IC799 | INDIAN AIRLINES | 10500 | 10 |
| MC101 | DECCAN AIRLINES | 3500 | 4 |
(a) Display FL_NO and NO_FLIGHT from KANPUR to BENGALURU from the table FLIGHTS.
(b) Arrange the contents of the table FLIGHTS in the ascending order of FL_NO.
(c) Display the FL_NO and fare to be paid for the flights from DELHI to MUMBAI using the tables FLIGHTS and FARES where the fare to be paid=FARE+FARE*TAX0.
(d) Display the minimum fare INDIAN AIRLINES is offering from the table FARES.
(e) SELECT FL_NO. NO_FLIGHT, AIRLINES FROM FLIGHTS, FARES
WHERE STARTING='DELHI' AND FLIGHTS.FL_NO=FARES.FL_NO;
(f) SELECT COUNT(DISTINCT ENDING) FROM FLIGHTS;
59.
Study the following tables DOCTOR and SALARY and write SQL commands for the equations (a) to (d) and give outputs for SQL queries (e) and (f)
TABLE: DOCTOR
| ID | NAME | DEPT | SEX | EXPERIENCE |
| 101 | John | ENT | M | 12 |
| 104 | Smith | ORTHOPEDIC | M | 5 |
| 107 | George | CARDIOLOGY | M | 10 |
| 114 | Lara | SKIN | F | 3 |
| 109 | K George | MEDICINE | F | 9 |
| 105 | Johnson | ORTHHOPEDIC | M | 10 |
| 117 | Lucy | ENT | F | 3 |
| 111 | Bill | MEDICINE | F | 12 |
| 130 | Morphy | ORTHOPEDIC | M | 15 |
TABLE: SALARY
| ID | BASIC | ALLOWANCE | CONSULTATION |
| 101 | 12000 | 1000 | 300 |
| 104 | 23000 | 2300 | 500 |
| 107 | 32000 | 4000 | 500 |
| 114 | 12000 | 5200 | 100 |
| 109 | 42000 | 1700 | 200 |
| 105 | 18900 | 1690 | 300 |
| 130 | 21700 | 2600 | 300 |
(a) Display NAME of all doctors who are in MEDICINE department having more than 10 yrs experience from the table DOCTOR.
(b) Display the average salary of all doctors working in ENT department using the tables DOCTOR and SALARY.SALARY=BASIC+ ALLOWANCE.
(c) Display the minimum ALLOWANCE of female doctors.
(d) Display the highest consultation fee among all male doctors.
(e) SELECT COUNT(*) FROM DOCTOR WHERE SEX='F';
(f) SELECT NAME, DEPT, BASIC FROM DOCTOR, SALARY
WHERE DEPT='ENT' AND DOCTOR.ID=SALARY.ID;
60.
Consider the following tables STUDENT and STREAM. Write SQL commands for the statements(a) to (d) and give outputs for SQL queries (e) to (h).
TABLE: STUDENT
| SCODE | NAME | AGE | STRCDE | POINTS | GRADE |
| 101 | Amit | 16 | 1 | 6 | NULL |
| 102 | Arjun | 13 | 3 | 4 | NULL |
| 103 | Zaheer | 14 | 2 | 1 | NULL |
| 105 | Gagan | 15 | 5 | 2 | NULL |
| 108 | Kumar | 13 | 6 | 8 | NULL |
| 109 | Rajesh | 17 | 5 | 8 | NULL |
| 110 | Naveen | 13 | 3 | 9 | NULL |
| 113 | Ajay | 16 | 2 | 3 | NULL |
| 115 | Kapil | 14 | 3 | 2 | NULL |
| 120 | Gurdeep | 15 | 2 | 6 | NULL |
TABLE: STREAM
| STRDE | STRNAME |
| 1 | SCIENCE+COMP |
| 2 | SCIENCE+BIO |
| 3 | SCIENCE+ECO |
| 4 | COMMERCE+MATHS |
| 5 | COMMERCE+SOCIO |
| 6 | ARTS+MATHS |
| 7 | ARTS+SOCIO |
(a) To display the name of streams in alphabetical order from table STREAM.
(b) To display the number of students whose POINTS are more than 5.
(c) To update GRADE to 'A' for all those students, who are getting more than 8 as POINTS.
(d) ARTS+MATHS stream is no more available. Make necesary change in table STREAM.
(e) SELECT SUM(POINTS) FROM STUDENT WHERE AGE>14;
(f) SELECT STRCDE, MAX(POINTS) FROM STUDENT GROUP BY STRCDE HAVING SCODE BETWEEN 105 AND 130;
(g) SELECT AVG(AGE) FROM STUDENT WHERE SCODE IN(102,105,110,120);
(h) SELECT COUNT(STRNAME) FROM STREAM WHERE STRNAME LIKE "SCI%";
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;
62.
Write SQL queries for (a) to (f) and write the output for the SQL queries mentioned in (g) parts (i) to (iv) on the basis of tables ITEMS and TRADERS.
TABLE: ITEMS
| code | IName | Qty | price | company | Tcode |
| 1001 | DIGITAL PAD 121 | 120 | 11000 | XENITA | T01 |
| 1006 | LED SCREEN 40 | 70 | 38000 | SANTORA | T02 |
| 1004 | CAR GPS SYSTEM | 50 | 2150 | GEOKNOW | T01 |
| 1003 | DIGITAL CAMERA 12X | 160 | 8000 | DIGICLICK | T02 |
| 1005 | PEN DRIVE 32 GB | 600 | 1200 | STOREHOME | T03 |
TABLE: TRADERS
| Tcode | TName | City |
| T01 | ELECTRONIC SALES | MUMBAI |
| T03 | BUSY STORE CORP | DELHI |
| T02 | DISP HOUSE INC | CHENNAI |
(a) To display the details of all the items in ascending order of item names(i.e. INAME).
(b) To display item name and price of all those items whose price is in the range of 10000 nd 22000(both values inclusive)
(c) To display the number of items, which are traded by each trader. The expected output of this query should be:
| T01 | 2 |
| T03 | 1 |
| T02 | 2 |
(d) To display the Price, item name(ie.name) and quantity(ie.Qty) of those items, which have quantity more than 150.
(e) To display the names of those traders, who are either from DELHI or from MUMBAI.
(f) To display the name of the companies and the name of the items in descending order of company names.
(g) Obtain the outputs of the following SQL queries based on the data given in the tables ITEMS and TRADERS above.
(i) SELECT MAX(Price), MIN(Price) FROM ITEMS;
(ii) SELECT Price * Qty AMOUNT
FROM ITEMS WHERE Code=1004;
(iii) SELECT DISTINCT Tcode FROM ITEMS;
(iv) SELECT IName, TName
FROM ITEMS I, TRADERS T
WHERE I.Code=T.TCode AND Qty<100;
1.
(A+C)(A’+B)
2.
F( X , Y , Z ) = ∏ (4 , 5 , 6 , 7)
= Σ (0 , 1 , 2 , 3)
= X’. Y’. Z’ + X’. Y’. Z + X’. Y. Z’ + X’. Y. Z
3.
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.
void DispMidRowCol(int Arr[][5], int s)
{
int mid = s/2, i;
cout<<"Middle row';
for(i=0;i<s;i++)
coutr<<Arr[mid][i]<<" ";
cout<<"Middle Column";
for(i=0; i<s; i++)
cout<<Arr[i][mid]<<" ";
cout<<end1;
}
6.
void Get1FRom2(int FIRST[],int ECOND[],
{
int ALL[6];
for(j=1,i=0;j
ALL[i] = FIRST[j];
}
for(j=1,i=0;J
ALL[j] = SECOND[i];
}
}
7.
void Jumpto(int N1, int N2=20);
#include<iostream.h>
void main()
{
int First=10,Second=20;
Jumpto(First,Second);
Jumpto(Second);
}
void Jumpto(int N!,int N2=20)
{
N1=N1+N2;
cout<<N1<<N2;
}
8.
Minimum value is 6
Maximum value is 8
Expected output : (ii) and (iii)
9.
5:1:20
1:1:50
5:2:50
10.
Line 1=5&8
Line 2=11&9
Line 1=6&9
Line 1=12&10
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.
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.
13.
25
6
27
14.
15.
16.
Note: in this question, we have to add new object, so we have to use app mode.
void add_obj( )
{ customer C;
ofstream outf (“Customer.dat”, ios::binary||ios::app);
if(!outf)
{cout<<”Error”; exit(0);}
else
{ C.enterdata();
Outf.write((char*)&C, sizeof(C));
Out.close();
}
}
17.
2
18.
| Scanned Elements | Operation | Stack Status |
| 20 | Push | 20 |
| 10 | Push | 20,10 |
| + | Pop twice 10+20=30 Push |
30 |
| 5 | Push | 30,5 |
| 2 | Push | 30,5,2 |
| * | Pop twice 5*2=10 Push |
30 30,10 |
| - | Pop twice 30-10=20 Push |
20 |
| 10 | Push | 20,10 |
| / | Pop twice 20/10=2 Push |
2 |
Output 2
19.
#include<iostream.h>
#include<conio.h>
void main()
{
int count;
count = 1;
while(count<10)
{
cout<<count<<" ";
}
getch();
}
Output
1 2 3 4 5 6 7 8 9 10
20.
#include<iostream.h>
void main()
{
int code;
code =1;
if( code==1)
cout<<" The water was too warm\n"
else
cout<<" the water were all finished";
}
Output:
The water was too warm
Some of valid if-else statements are:
(i) If ((ch >= 'a') && (ch <= 'z'))
cout<<ch<<" is a lowercase letter";
cout<<ch<<" is not a lowercase letters";
(ii) if((age == 50) || (age >= 20))
cout<<" You are old";
else
cout<<" You are young";
21.
22.
23.
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 Display()
{
ifstream fcin("PLACES.TXT);
char ch[100];
fcin.getline(ch,100);
while(fcin)
{
if(Ch[0]=='P' ch[0]=="S")
{
cout<
}
fcin.close();
}
28.
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
29.
#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();
}
30.
(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.
31.
( )
File.seekg(0,ios::end); //Statement 1
File.tellg(); //Statement 2
32.
( )
File.seekg(RecNo*sizeof(Item)); //Statement 1
File.seekp(RecNo*sizeof(Item)); //Statement 2
33.
( )
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.
34.
( )
Distributive laws of boolean algebra state that:
(i) X.(Y+Z)=X.Y+X.Z
(ii) X+Y.Z=(X+Y).(X+Z)
Law X.(Y+Z)=X.Y+X.Z satisfy ordinary algebra for all values, whereas X+Y.Z=(X+Y).(X+Z) satisfy only for two values (0,1)of X, Y and Z.
35.
( )
\(\overset { \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ }{ (A.\bar { B } +\bar { C } .\bar { D } ) } \) \(=\overset { \_ \_ \_ \_ \_ \_ \_ \_ \_ \quad \quad \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ }{ (A.\bar { B } ).(\bar { C } +\bar { D } ) } \) [DeMorgan's law]
\(=(\bar { A } +\overset { \_ \_ \_ \_ }{ \bar { B } } ).(\overset { \_ \_ \_ }{ \bar { C } } +\overset { \_ \_ \_ \_ }{ \bar { D } } )\) [Demorgan's law]
\(=(\bar { A } +B).(C+D)\)
36.
( )
| 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\)
37.
( )
| P | Q | R | F | Minterms |
| 0 | 0 | 0 | 1 | \(\bar { P } .\bar { Q } .\bar { R } \) |
| 0 | 0 | 1 | 0 | \(\bar { P } .\bar { Q } .R \) |
| 0 | 1 | 0 | 0 | \(\bar { P } .Q .\bar { R } \) |
| 0 | 1 | 1 | 1 | \(\bar { P } . Q .R \) |
| 1 | 0 | 0 | 0 | \(P .\bar { Q } .\bar { R } \) |
| 1 | 0 | 1 | 0 | \(P .\bar { Q } .R \) |
| 1 | 1 | 0 | 1 | \(P.Q .\bar { R } \) |
| 1 | 1 | 1 | 1 | P.Q.R |
SOP form of function F(P, Q, R) is: \(=\bar { P } .\bar { Q } .\bar { R } +\bar { P } .Q.R+P.Q.\bar { R } +P.Q.R\)
38.
( )
Two common web browsers are:
(i) Mosaic
(ii) Internet Explorer
39.
( )
i)Select P_Name MAX(SAL) FROM PROGRAMMERS;
ii)UPDATE PROGRAMMERS SET SAL=SAL+2000 WHERE P_NAME LIKE "R%';
40.
( )
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');
41.
( )
CREATE TABLE STUDENT( ROLL Number NUMBER(5) Primary key, Name CHAR(20), Age NUMBER(2), MARKS NUMBER(4));
42.
( )
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;
43.
( )
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.
44.
( )
Switch/Hub and Repeaters.
45.
( )
Function of modem is to convert analog signals into digital signals. Modem also converts digital signal into analog signal. It is also used to connect Internet.
46.
( )
The network which the different countries network is known as WAN. It can be a group of LANs. The largest existing WAN is Internet. LAN is a group of computers and network devices connected together, usually within the same building whereas WAN is not restricted to geographical location, although it might be confined within the bounds of state country.
47.
( )
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:
48.
( )
Circular queue will be full if ((front==Rear + 1) (Fornt == 0 && Rear ==N-1))
49.
( )
(i) 10
(ii) Front = 6
50.
( )
In switch -case statement, when a match is found, the statement sequence associated with that case is executed until a break statement or the end of switch statement is reached. So, if break statement is missing, then the statement sequence is executed until the end of the switch-case statement is reached.
51.
( )
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.
52.
( )
Decleration of function is possible with overlading concept:
float bar(char ch)
{
__
__ statements
}
float bar(char ch1,char ch2)
{
__
__ statements
}
53.
( )
i) int intname;
intname=15;
ii) int intname=15;
54.
( )
Encapsulation means binding of data members and member functions (which operates on the data) into a single unit and ensure that only important features get represented without
background details I.e. called abstraction. Encapsulation is a way to implement data abstraction. Therefore,both are interrelated.
55.
( )
An identifier is the name given by user for a unit of the program.e.g.CHK, Z2TOZ9, etc.
Keywords are the reserved words that convey a special meaning to the language compiler. e.g. auto, break, etc.
56.
( )
There is no data type as long float in C++. The double data type denotes the same, thus the statement should be
double y;
57.
( )
i) 3 ii) 11
58.
(a) SELECT FL_NO, NO_FLIGHT FROM FLIGHTS
WHERE STARTING ='KANPUR' AND ENDING='BENGALURU';
(b) SELECT*FROM FLIGHTS ORDER BY FL_NO;
(c) SELECT FL_NO, FARE+FARE*TAX0 FROM FARES WHERE FL_NO=(SELECT FL_NO FROM FLIGHTS WHERE STARTING='DELHI' AND ENDING='MUMBAI');
(d) SELECT MIN(FARE) FROM FARES GROUP BY AIRLINES HAVING AIRLINES='INDIAN AIRLINES';
(e)
| FL_NO | NO_FLIGHT | AIRLINES |
| IC302 | 8 | INDIAN AIRLINES |
| AM501 | 1 | JET AIRWAYS |
| IC701 | 4 | INDIAN AIRLINES |
(f)
| COUNT(DISTINCT ENDING) |
| 7 |
59.
(a) SELECT NAME FROM DOCTOR WHERE EDPT ='MEDICINE' AN EXPERIENCE>10;
(b) SELECT AVG(BASIC+ALLOWANCE) FROM SALARY WHERE SALARY.ID IN(SELECT ID FROM DOCTOR WHERE DEPT='ENT');
(c) SELECT MIN(ALLOWANCE) FROM SALARY WHERE SALARY.ID IN(SELECT ID FROM DOCTORE WHERE SEX='F');
(d) SELECT MAX(CONSULTATION) FROM SALARY .ID IN(SELECT ID FROM DOCTOR WHERE SEX='M');
(e)
| COUNT(*) |
| 4 |
(f)
| NAME | DEPT | BASIC |
| John | ENT | 12000 |
60.
(a) SELECT STRNAME FROM STREAM ORDER BY STRNAME;
(b) SELECT COUNT(*) FROM STUDENT WHERE POINTS>5;
(c) UPDATE STUDENT SET GRADE='A' WHERE POINTS>8;
(d) DELETE FROM STREAM WHERE STRCDE=6;
(e)
| SUM(POINTS) |
| 25 |
(f)
| STRCDE | MAX(POINTS) |
| 2 | 6 |
| 3 | 9 |
| 5 | 8 |
| 6 | 8 |
(g)
| AVG(AGE) |
| 14 |
(h)
| COUNT(STRNAME) |
| 3 |
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 |
62.
(a) SELECT *FROM ITEMS ORDER BY IName;
(b) SELECT IName, Price FROM ITEMS
WHERE Price BETWEEN 10000 AND 22000;
(c) SELECT TCode, COUNT(*) FROM ITEMS
GROUP BY TCode;
(d) SELECT Price, IName, Qty
FROM ITEMS
WHERE Qty>150;
(e) SELECT TName
FROM TRADERS
WHERE City ='MUMBAI' OR City='DELHI';
(f) SELECT Company, IName
FROM ITEMS
ORDER BY Company DESC;
(g) (i)
| MAX(Price) | MIN(Price) |
| 38000 | 1200 |
(ii)
| AMOUNT |
| 107500 |
(iii)
| TCode |
| T01 |
| T02 |
| T03 |
(iv)
| IName | TName |
| CAR GPS SYSTEM | ELECTRONIC SALES |
| LED SCREEN 40 | DISP HOUSE INC |
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