Kendriya Vidyalaya Drdo Complex C.V.Raman Nagar Bangalore 93 Aissce 2011 Practical Examination

Total Page:16

File Type:pdf, Size:1020Kb

Kendriya Vidyalaya Drdo Complex C.V.Raman Nagar Bangalore 93 Aissce 2011 Practical Examination

KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: (a) Write Object Oriented C++ Program to sort the given array of structure in ascending order of average marks using SELECTION Sort. struct student { char name[20]; int avgmak; }; (b) Consider the following tables GAMES and PLAYER. Write SQL commands for the statements (i) to (iv) Table: GAMES GCode GameName Number PrizeMoney ScheduleDate 101 Carom Board 2 5000 23-Jan-2004 102 Badminton 2 12000 12-Dec-2003 103 Table Tennis 4 8000 14-Feb-2004 105 Chess 2 9000 01-Jan-2004 108 Lawn Tennis 4 25000 19-Mar-2004 Table: PLAYER PCode Name Gcode 1 Nabi Ahmad 101 2 Ravi Sahai 108 3 Jatin 101 4 Nazneen 103

(i) To display the name of all Games with their Gcodes (ii) To display details of those games which are having PrizeMoney more than 7000. (iii) To display the content of the GAMES table in ascending order of ScheduleDate. (iv) To display sum of PrizeMoney for each of the Number of participation groupings (as shown in column Number 2 or 4) Output for the SQL queries. (i) SELECT COUNT(DISTINCT Number) FROM GAMES; (vi) SELECT MAX(ScheduleDate),MIN(ScheduleDate) , COUNT(*) FROM GAMES GROUP BY Game Name; (vii) SELECT SUM(PrizeMoney) FROM GAMES; (viii) SELECT DISTINCT Gcode FROM PLAYER; (C) F(a,b,c,d)= ∑ (1,3,4,5,7,9,11,12,13,15) obtain the simplified form using K-Map. Draw Logic diagram. 2

1 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO:

(a) Write an Object Oriented C++ Program to implement circular queue of INTEGERS.(Array)

(b) Given the following LAB table, write SQL command for the questions (i) to (iii) LAB No ItemName CostPerItem Quantity Dateofpurchase Warranty Operational 1 Computer 60000 9 21/5/96 2 7 2 Printer 15000 3 21/5/97 4 2 3 Scanner 18000 1 29/8/98 3 1 4 Camera 21000 2 13/10/96 1 1 5 Switch 8000 1 31/10/99 2 1 6 UPS 5000 5 21/5/96 1 4 7 Router 25000 2 11/1/2000 2 5

(i) To display the ItemName,whose CostPerItem is more than 20000. (ii) To display all the itemName whose name starts with “C”. (iii) To list the ItemName in ascending order of the date of purchase. (iv)Increase the warranty by 3 for camera. (v) Give the output of the following SQL commands: (a) select min(DISTINCT Quantity) from LAB; (b) select max(Warranty) from LAB; (c) select sum(CostPerItem) from LAB; (d) select ItemName from lab where name like ‘C%’; c) Obtain a simplified form for a Boolean expression 2 F(x,y,z,w)=∑(0,1,3,4,5,6,7,9,10,11,13,15) using Karnaugh map. Draw logic diagram.

2 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: (a) Write an Object Oriented C++ Program to insert into and delete an element from a dynamically allocated queue (linked list ) where each node contains a floating point number. W_ID SALARY BENEFITS DESIGNATION (b) Consider the following tables EMPLOYEE and 102 75000 15000 MANAGER DESIG. write SQL commands for the statements 105 85000 25000 DIRECTOR (i) to (iv) and give outputs for SQL queries (v) to 144 70000 15000 MANAGER (viii) 210 75000 12500 MANAGER 255 50000 12000 CLERK EMPLOYEE 300 45000 10000 CLERK DESIG 335 40000 10000 CLERK W_ID FIRSTNAME LASTNAME CITY 400 32000 7500 SALESMAN 102 SAM TONES PARIS 451 28000 7500 SALESMAN 105 SARAH ACKERMAN NEW YORK 144 MANILA SENGUPTA NEW DELHI 210 GEORGE SMITH HOWARD 255 MARY JONES HUSTON 300 ROBERT SAMUEL WASHINGTON 335 HENRY WILLIAMS BOSTON 400 RONNY LEE NEW YORK 451 PAT THOMPSON PARIS

(i) Display FirstName and City of Employee having salary between 50,000 and 90,000 (ii) Display details of Employees who are from “PARIS” city. (iii) Increase the benefits of employee having W_ID = 210 by 500. (iv) Count number of employees whose name starts from character ‘S’. (v) Select MAX(salary) from desig (vi) Select FirstName from employee, desig where designation = ‘MANAGER’ AND employee.W_ID = desig.W_ID; (vii) Select COUNT (DISTINCT designation) from desig; (viii) Select designation, SUM(salary) from desig Group by designation Having count (*) > 2; (c ) Obtain a simplified form for the following Boolean Expression using K – Map: F(u,v,w,z) = ∑(0,3,4,5,7,11,13,15) Draw logic diagram.

(a) Write an Object Oriented C++ Program to arrange the array of Employee structure in ascending order of Salary using BUBBLE Sort. 3 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: struct EMPL { char Name[20]; int EmpId; float Salary; };

(b) Study the following tables STAFF and SALARY and write SQL commands for the question (i) to (iv) and give output for SQL queries (v) to (vi) relation : STAFF relation : SALARY ID NAME DOJ DEPT SEX QUALF ID BASIC ALLOWANCE COMM_PERC 101 Siddharth 12/01/02 Sales M MBA 101 15240 5400 3 104 Raghav 8/05/88 Finance M CA 104 23000 1452 4 107 Naman 14/05/88 Research M MTECH 107 14870 2451 3 114 Nupur 1/02/03 Sales F MBA 114 21000 3451 14 109 Janvi 18/7/04 Finance F ICWA 109 24500 1452 10 105 Rama 14/4/07 Research M BTECH 105 17000 1250 2 117 Jace 27/6/87 Sales F MTECH 117 12450 1400 3 111 Binoy 12/1/90 Finance M CA 111 13541 3652 9 130 Samuel 7/3/99 Sales M MBA 130 25000 4785 15 187 Ragini 12/12/02 Research F BTECH 187 14823 5862 2

i) Display the name of all CA’s. ii) Display the number of staff joined year-wise iii) Hike the Allowance by 2000 for all staff whose ID is less than 105. iv) Display the average salary given to the employee in each department v) SELECT DEPT, COUNT(*) FROM STAFF WHERE SEX=’m’ GROUP BY DEPT HAVING COUNT(*) >2; vi) SELECT AVG(BASIC+ ALLOWANCE), QUALF FROM SALARY S1, STAFF S2 WHERE S1.ID=S2.ID GROUP BY QUALF; vii) SELECT DISTINCT QUALF FROM STAFF viii) SELECT NAME, BASIC+ALLOWANCE FROM STAFF S, SALARY SA WHERE S.ID=SA.ID AND YEAR(DOJ)<2002 ;

(c ) Reduce the following Boolean expression using K-Map: F (A, B, C, D) = (0, 1, 2, 3, 4, 5, 10, 11, 15)

(a) Write an Object Oriented C++ Program to insert into and delete an element from a dynamically allocated stack (linked list ) where each node contains a floating point number.

4 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: (b) Consider the following tables SCHOOL and ADMIN. Write SQL commands for the statements (i) to (ix). SCHOOL CODE TEACHERNAME SUBJECT DOJ PERIODS EXPERIENCE 1001 RAVI SHANKAR ENGLISH 12/03/2000 24 10 1009 PRIYA RAI PHYSICS 03/09/1998 26 12 1203 LISA ANAND ENGLISH 09/04/2000 27 5 1045 YASHRAJ MATHS 24/08/2000 24 15 1123 GANAN PHYSICS 16/07/1999 28 3 1167 HARISH B CHEMISTRY 19/10/1999 27 5 1215 UMESH PHYSICS 11/05/1998 22 16 ADMIN CODE GENDER DESIGNATION 1001 MALE VICE PRINCIPAL 1009 FEMALE COORDINATOR 1203 FEMALE COORDINATOR 1045 MALE HOD 1123 MALE SENIOR TEACHER 1167 MALE SENIOR TEACHER 1215 MALE HOD

a. To display TEACHERNAME, PERIODS of all teachers whose periods less than 25 and name start with R. b. Display the contents of school table in descending order of teacher name. c. Display details of all from table school where experience is between 10 and 20. d. To display TEACHERNAME, CODE and DESIGNATION from tables SCHOOL and ADMIN for female teacher.. e. To display the TEACHERNAME who have minimum PERIODS. f. Increase 2 years experience in all the female records. g. Delete all the records of subject physics. h. Insert a row in ADMIN TABLE. (c) Reduce the following Boolean expression using K-map. 3 F(A,B,C,D)= (0,1,2,4,5,6,8,10)

(a) Write Object Oriented C++ Program to sort the given array of structure in ascending order of average marks using INSERTION SORT Sort. struct student { char name[20];

5 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: int avgmak; }; (b).Consider the following workers and desig. Write SQL commands for the statements and give outputs for SQL queries WORKERS W_ID FIRSTNAME LASTNAME ADDRESS CITY 102 Sam Tones 33 Elm St. Paris 105 Sarah Ackerman 440 U.S. 110 New York 144 Manila Sengupta 24 Friends Street New Delhi 210 George Smith 83 First Street Howard 255 Mary Jones 842 Vine Ave. Losantiville 300 Robert Samuel 9 Fifth Cross Wasington 335 Henry Williams 12Moore Street Boston 403 Ronny Lee 121 Harrison St. New York 451 Pat Thompson 11 Red Road Paris

DESIG W_ID SALARY BENEFITS DESIGNATION 102 75000 15000 Manager 105 85000 25000 Director 144 70000 15000 Manager 210 75000 12500 Manager 255 50000 12000 Clerk 300 45000 10000 Clerk 335 40000 10000 Clerk 400 32000 7500 Salesman 451 28000 7500 Salesman (i) To display w_id, firstname, address and city of all employees living in new york from the table workers. (ii) To display the content of workers table in ascending order of lastname. (iii) To display the firstname, lastname and total salary of all alerks from the tables workers and design, where total salary is calculated as salary + benefits. (iv)To display the minimum salary among Managers from the table DESIG. (v) SELECT FIRSTNAME, SALARY FROM WORKERS, DESIG WHERE DESIGNATION = ‘Manager’ AND WORKERS.W_ID = DESIG.W_ID (vi)SELECT COUNT(DISTINCT DESIGNATION) FROM DESIG. (vii) SELECT DESIGNATION, SUM(SALARY FROM DESIGNATION GROUP BY DESIGNATION HAVING COUNT(*)<3; (viii) SELECT SUM(BENEFITS) FROM WORKERS WHERE DESIGNATION = ‘Salesman’; (C) Reduce the following Boolean expression using K . Map :Draw logic diagram. [2] F(P, Q, R, S,) =∑ (0,3,5,6,7,11,12,15)

(a) Write an Object Oriented C++ Program to insert into and delete an element from a stack (Array) where each element of array contains a floating point number. 12

6 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: (b) Consider the following EMP table. Write SQL commands for the statements and give outputs for SQL queries 5 TABLE : EMP EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO 7839 REA MANAGER 67 12-DEC-98 5000 0 10 1234 PREM CLERK 87 11-FEB-77 12000 1500 20 6754 SITA MANAGER 89 12-MAR-99 10000 1000 20 6574 GITA SALESMAN 98 11-JUN-99 9000 0 30 9876 HONEY CLERK 65 12-JUN-00 12000 800 20 8976 REEMA SALESMAN 91 10-SEP-88 6000 100 30

I. Display names of employees whose names include either of the substring “TH” or “LL”. II. Display data of all employees sorted by their department and salary. III. Find all the employees who are working under manager 87. IV. To display all employees who work in the department of PREM . V. Show the average salary for all departments. VI. Find out number of employees having ‘MANAGER’ as job. VII. Display department no. and number of employees in each department. VIII. Find the output of the following : 1. SELECT SYSDATE FROM DUAL; 2. SELECT ENAME,SAL FROM EMPLOYEE WHERE DEPTNO=20; 3. SELECT COUNT(*) FROM EMP; 4. SELECT AVG(SAL) FROM EMP; (c) Reduce the following Boolean expression using K-map. Draw logic diagram. 2 F(P,Q,R,S)=  (1,2,3,4,5,6,7,9,11,12,13,15)

(a) Each node of a STACK contains the following information, in addition to required pointer field : (i) Employee number of the employee (ii) Employee Name (iii) Salary. Give the structure, class for the linked stack in question

7 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: TOP is pointer to the topmost node of the stack. Write an object oriented C++ program to implement the stack which is allocated dynamically.

(b) Write SQL commands for the statements on the basis of the table EMPLOYEE:

Name EmpNo DeptNo Job Sal Comm G. Hussain 2098 10 President 7000 Pallav 3099 30 Manager 9000 1400 Y.D. Sharma 8001 20 Clerk 8500 Bhawna 7901 10 President 4520 300 A. Dasgupta 5400 20 Analyst 6580 P. Arora 3400 10 Clerk 12000 Col. Singhvi 2100 30 Manager 1200 500 Amit 3100 30 Analyst 3250 A D’souza 2211 10 Clerk 6900

i. Show sum and average salary for marketing deptt. i. Check all employees have unique names. ii. Find al employess whose deptt is same as of ‘Amit’. iii. Increase the salary of all employees by 10%, iv. Find the deptt that is paying max salaries to its employees. v. Display the details of all the employees having salary less than 10000. (c) Reduce the following Boolean Expression using K-Map: Draw logic diagram. 2 F(A,B,C,D)=(0,1,2,4,5,6,8,10,11,14,15)

(a) Write an Object Oriented C++ program to search for an item present in an array which is in ascending order using Binary search method.

8 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: (b) Write SQL commands for the queries given from (i) to (iv) and write the outputs for SQL queries (v) based on relation CLUB given below :

Table : CLUB Mcode Mname Sex Age Fees Type 1 Ashish M 25 6550 Monthly 2 Madhulika F 29 7124 Monthly 3 Niti Singh F 31 18000 Yearly 4 Pratyush M 55 1200 Quarterly 5 Venus Sah F 19 7600 Monthly 6 Anand Seth M 45 19500 Life

i) to create above table. ii) to display Mname, age & fees of those club members whose fees is between 10000 to 15000. iii) to display Mcode, Mname & Type of all-female members with age in descending order.

iv) to display the total fees of the male and female members separately in a single command.

v) Give the output of the following SQL commands : a) SELECT COUNT(*) FROM CLUB WHERE TYPE=”Monthly” AND FEES>=7124; b) SELECT AVG(AGE) FROM CLUB WHERE TYPE=”Yearly” OR TYPE=”Quarterly”; (c) Reduce the following Boolean Expression using K-Map: 2 F(A,B,C,D)= π(2,3,4,5,6,7,8,10,11)

9 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: (a) Consider the following key set : 42, 29, 74, 11, 65, 58, Write an Object Oriented C++ program to, use Bubble sort to sort the data in Descending order and indicate the sequences of steps required.

(b)Consider the following tables. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii)

Table:PRODUCT P-ID PRODUCTNAME MANUFACTURER PRICE TP01 Talcom Powder LAK 40 FW05 Face Wash ABC 45 BS01 Bath soap ABC 55 SH06 Shampoo XYZ 120 FW12 Face Wash XYZ 95 Table:CLIENT C_ID CLIENTNAME P_ID CITY 01 Cosmetic Soap FW05 Delhi 06 Total Health BS01 Mumbai 12 Live life SH06 Delhi 15 Pretty Woman FW12 Delhi 16 Dreams TP01 Banglore

(i) To display the details of those clients whose city is Delhi. (ii) To display the details of the Products whose price is in the range of 50 to 100 (Both values included) (iii) To display the Clientname,city from table client and Productname and price from table product, with their corresponding matching P_ID.

(iv) To increase the price of all products by 10. (v) SELECT Distinct City from client; (vi) SELECT Manufacturer ,Max(price),Min(price),count(*) from product group by manufacturer.

(vii) SELECT clientname,manufacturer from product,client where client.p_id=product.p_id;

(viii) SELECT productname,price*4 from product;

(c) Reduce the following Boolean Expression using K-Map: 2 F(A,B,C,D)= (2,3,4,5,6,7,8,10,11)

10 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO:

I. Define functions stackpush( ) to insert nodes and stackpop( ) to delete nodes, for a linked list implemented stack having the following structure for each node: struct node { char name[20]; int age; node *LINK; };

Write an object oriented C++ program to implement the stack which is allocated dynamically.

II. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii): on the basis of the table BOOKS Book_Id Book_Name Author_name Publishers Price Type Quantity F0001 The Tears William Hopkins First Publ. 750 Fiction 10 F0002 Thunderbolt Anna Roberts First Publ. 700 Fiction 5 T0001 MyFirstC++ Brain & Brooke EPB 250 Text 10 T0002 C++Brain A.W. Rossaine TDH 325 Text 5 C0001 Fast Cook Lata Kapoor EPB 350 Cooker 8 y ISSUED Book_Id Quantity_Issued F0001 3 T0001 1 C0001 5 (a) To show Book name, Author name and Price of books of EPB Publishers. (b) To list the names from books of Fiction type. (c) To display the names and price of the books in descending order of their price. (d) To increase the price of all books of First Publ. Publishers by 50. (e) To display the Book_Id, Book_Name and Quantity_Issued for all books which have been issued. (The query will require contents from both the tables.) (f) To insert a new row in the table Issued having the following data: ‘F0002’, 4. (g) Give the output: (i) SELECT COUNT (DISTINCT Publishers) FROM Books; (ii) SELECT SUM(Price) FROM Books WHERE Quantity > 5; (iii) SELECT Book_Name, Author_Name FROM Books WHERE Price <500; (iv) SELECT COUNT (*) FROM Books;

11 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: III.Reduce the following Boolean Expression using K-Map: Draw logic diagram 2 F(U,V,W,Z)= ∑(0,1,4,5,6,7,11,12,13,14,15) (a) Write an Object Oriented C++ program to search for an item present in an array which is in descending order using Binary search method.

(b)Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii): on the basis of the table

(i) To display the names of all senders from Mumbai. (ii) To display the recID, senderName, senderAddress, RecName,RecAddress for every recipt. (ii) To display the sender details in ascending order of SenderName. (iv) To display number of Recipients from each city. (v) SELECT DISTINCT SenderCity FROM Sender; (vi) SELECT A.SenderName A, B.RecName FROM Sender A, Recipient B WHERE A.SenderID=B. SenderID AND B.RecCity=.Mumbai.; (vii) SELECT RecName,RecAddress FROM Recipient WHERE RecCity Not IN (.Mumbai., Kolkata.); (viii) SELECT RecID, RecName FROM Recipient WHERE SenderID = MU02. OR SenderID = ND50; (c ) Reduce the following Boolean Expression using K-Map: Draw logic diagram 2 F(U,V,W,Z)= π(0,1,4,5,6,7,11,12,13,14,15)

12 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO:

(a) Write an Object Oriented C++ program to search for an item present in an array which is in ascending order using Linear search method.

(b) Study the following tables CPU and MONITOR and write SQL commands for the questions (i) to (iv) and give outputs for SQL queries (v) to (vi).

Table : MONITOR

TAB_NO MAKE COLOR MODEL YEAR MON_NO 1 Zenith Black CRT 2004 Z_08 2 Samsung White CRT 2004 S_01 3 Samsung White CRT 2004 S_02 4 LG Black LCD 2008 L_01 5 LG Black LCD 2008 L_02 6 LG Black LCD 2008 L_03 7 LG Black LCD 2008 L_04

Table : CPU

TAB_NO MODEL COLOR YEAR CPU_NO 1 Zenith Black 2003 Z_12 2 Zenith Black 2003 Z_08 3 Wipro Black 2005 W_04 4 Wipro Black 2006 W_24 5 Wipro Black 2008 W_25 6 LG Gray 2008 L_01 7 LG Gray 2008 L_02

i. Display the table number, cpu model, year of all the cpu whose color is black. ii. Arrange the contents of table CPU in descending order of YEAR. iii. Display the table number, model of CPU, make of monitor that has CPU and monitor color black iv. Display number of models in each model of monitor. v. select count(make) from monitor where year between 2003 and 2007; vi. select cpu.tab_no, cpu.model, monitor.model from cpu, monitor where cpu.color='Black' AND monitor.color='Black' AND cpu.tab_no = monitor.tab_no; (c ) Obtain a simplified form for a Boolean expression 2 F (a, b , c, d) = ∏ ( 0, 1, 3, 4, 5, 6, 7, 9, 10, 11, 13, 15) using Karnaugh Map. 13 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO:

(a) Give necessary declarations for a queue containing name and float type number ; also write an Object Oriented C++ Program to insert and delete a node from the queue. You should use linked representation of queue.

(b) Consider the following tables GAMES and PLAYER. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii)

Table: GAMES GCode GameName Number PrizeMoney ScheduleDate 101 Carom Board 2 5000 23-Jan-2004 102 Badminton 2 12000 12-Dec-2003 103 Table Tennis 4 8000 14-Feb-2004 105 Chess 2 9000 01-Jan-2004 108 Lawn Tennis 4 25000 19-Mar-2004

Table: PLAYER PCod Name Gcode e 1 Nabi Ahmad 101 2 Ravi Sahai 108 3 Jatin 101 4 Nazneen 103

(i) To display the name of all Games with their Gcodes (ii) To display details of those games which are having PrizeMoney more than 7000. (iii) To display the content of the GAMES table in ascending order of ScheduleDate. (iv) To display sum of PrizeMoney for each of the Number of participation groupings (as shown in column Number 2 or 4) (v) SELECT COUNT(DISTINCT Number) FROM GAMES; (vi) SELECT MAX(ScheduleDate),MIN(ScheduleDate) , COUNT(*) FROM GAMES GROUP BY Game Name; (vii) SELECT SUM(PrizeMoney) FROM GAMES; (ix) SELECT DISTINCT Gcode FROM PLAYER; (c )Obtain a simplified form for a Boolean expression 2 F (a, b , c, d) = ∑( 0, 1, 3, 4, 5, 6, 7, 9, 10, 11, 13, 15) using Karnaugh Map.

14 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO:

(a) Write an Object Oriented C++ Program to implement circular queue of CHARECTERS.(Array)

(b) Given the following tables for a database FURNITURE :Write SQL command for (a) to (d) and write the outputs for (e) on the basis of tables FURNITURE and ARRIVALS.

Table: FURNITURE NO. ITEMNAME TYPE DATEOFSTOCKPRICE DISCOUNT 1 White lotus Double Bed 23/02/02 30000 25 2 Pink teather Baby cot 20/01/02 7000 20 3 Dolphin Baby cot 19/02/02 9500 20 4 Decent Office Table 01/01/02 25000 30 5. Comfort zone Double Bed 12/01/02 25000 25 6 Donald Baby cot 24/02/02 6500 15 7 Royal Finish Office Table 20/02/02 18000 30 8 Royal tiger Sofa 22/02/02 31000 30 9 Econo sitting Sofa 13/12/01 9500 25 10 Eating Paradise Dining Table 19/02/02 11500 25

Table : ARRIVALS NO. ITEMNAME TYPE DATEOFSTOCK PRICE DISCOUNT . 11 Wood Comfort Double Bed 23/03/03 25000 25 12 Old Fox Sofa 20/02/03 17000 20 13 Micky Baby cot 21/02/03 7500 15 (a). To list the ITEMNAME which are priced at more than 15000 from the FURNITURE table. (b) To list ITEMNAME of each TYPE. (c) To display ITEMNAME and DATEOFSTOCK of those items, in which the DISCOUNT percentage is more than 25 from FURNITURE table. (d) To count the number of items, whose TYPE is ‘Sofa’ from FURNITURE table. (e) Give the output of fol1owing SQL statement: Note: Outputs of the below mentioned queries should be based on original data given in both the tables . (i) Select COUNT(distinct TYPE) from FURNITURE; (ii) Select MAX(DISCOUNT) from FURNITURE, ARRIVALS; (iil) Select AVG(DISCOUNT) from FURNITURE where TYPE = ‘Baby cot’ ; (iii) Select SUM(PRICE) from FURNITURE; (c ) If F(a,b,c,d) =(0,1,3,4,5,7,8,9,11,12,13,15), obtain the simplified form using K-Map. 2

15 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: (a) Write an Object Oriented C++ Program to insert and delete a node from the queue. You should use Array to representation of queue.

(b) Write the SQL commands for the following on the basis of tables INTERIORS and NEWONES

Table: INTERORS SNO ITEMNAME TYPE DATEOFSTOCK PRICE DISCOUNT 1 Red Rose Double Bed 23/02/02 32000 15 2 Soft Touch Baby Cot 20/1//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

Table: NEWONES SNO ITEMNAME TYPE DATEOFSTOCK PRICE DISCOUNT 11 White Wood Double Bed 23/02/02 20000 20 12 James 007 Sofa 20/02/03 15000 15 13 Tom Look Baby Cot 21/02/03 7000 10

(i) To list the ITEMNAME which are priced at more than 1000 from the INTERIORS table (ii) To show all information about the sofas from the INTERIORS table (iii) To display ITEMNAME and DATEOF STOCK of those items in which the discount percentage is more than 15 from INTERIORS table (iv) To count the number of items, whose type is “Double Bed” from INTERIORS table (v) To insert a new row in the NEWONES table with the following data 14,”True Indian”, “Office Table”, 28/03/03,15000,20 c) Get the Output (Use the above table without inserting the record) i. Select COUNT(distinct TYPE) from INTERIORS ii. Select AVG(DISCOUNT) from INTERIORS where TYPE=”Baby Cot” iii. Select MAX(Price) from INTERIORS , NEWONES; d) If F(a,b,c,d) =π(0,1,3,4,5,7,8,9,11,12,13,15), obtain the simplified form using K-Map. 2

16 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: (a) Write an Object Oriented C++ Program to sort an array of structure Examinee in descending order of score using SELECTION sort. struct Examinee { long rollno; char name[20]; float Score; }; (b) Consider the following tables FACULTY and COURSES. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries C_ID F_ID Cname Fees (v) to (viii) C21 102 Grid Computing 40000 FACULTY C22 106 System Design 16000 C23 104 Computer Security 8000 COURSES C24 106 Human Biology 15000 C25 102 Computer Network 20000 C26 105 Visual Basic 6000 F_ID Fname Lname Hire_date Salary C27 107 Dreamweaver 4000 102 Amit Mishra 12-10-1998 12000 103 Nitin Vyas 24-12-1994 8000 104 Rakshit Soni 18-5-2001 14000 105 Rashmi Malhotra 11-9-2004 11000 106 Sulekha Srivastava 5-6-2006 10000 107 Niranjan Kumar 26-8-1996 16000 (i) To display details of those Faculties whose salary is greater than 12000. (ii) To display the details of courses whose fees is in the range of 15000 to 50000 (both values included). (iii) To increase the fees of all courses by 500. (iv) To display details of those courses which are taught by ‘Sulekha’. (v) Select COUNT(DISTINCT F_ID) from COURSES; (vi) Select MIN(Salary) from FACULTY,COURSES where COURSES.F_ID = FACULTY.F_ID; (vii) Select SUM(Fees) from courses Group By F_ID having count(*) > 1; (viii) Select Fname, Lname from FACULTY Where Lname like “M%”; (c ) If F(P,Q,R,S) =  (3,4,5,6,7,11,13,15), obtain the simplified form using K-Map. 2

(a).Write an Object Oriented C++ Program to sort an array of structure Game in descending order of score using INSERTION sort.

17 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: struct Game { long Pno; char Pname[20]; long points; }; (b).Study the following tables TOUR and ACCOMODATION and write SQL commands for the questions) and give outputs for SQL queries

Table : TOUR Table : ACCOMODATION

SNO STUNO NAME STD DELHI CHENNAI POCKET STUNO ROOMNO FLOOR FOOD 1 B01 Arun XII LB MB 2000 B01 201 II Veg 2 B02 Alex XII MB UB 2500 B02 201 II N Veg 3 B03 Arjun XII LB LB 2000 B03 202 II N Veg 4 B04 Amar XII UB UB 1500 B04 202 II Veg 5 G01 Annie XII LB LB 2500 G01 402 IV Veg 6 G02 Avanthika XII MB UB 1500 G02 402 IV Veg 7 G03 Ashwini XII UB MB 3500 G03 403 IV Veg

Note : In Stuno B stands for Boys and G stands for Girls Delhi refers Train to Delhi Chennai refers Train to Chennai LB – Lower Berth MB – Middle Berth UB – Upper Berth i. Display the details of student who got lower berth in both Delhi and Chennai train. ii. Display the name of students whose food choice is Veg. iii. Display the number of rooms booked by the student. iv. Display the room number and sum of pocket money of students staying in that room. v. select tour.stuno, name, roomno from tour, accomodation where accomodation.stuno = tour.stuno; vi. select count(pocket), sum (pocket) from tour, accomodation where tour.stuno = accomodation.stuno AND food ='N Veg'; (c ) If F(P,Q,R,S) = π (3,4,5,6,7,11,13,15), obtain the simplified form using K-Map. 2

(a). Write an Object Oriented C++ Program to arrange each row of the two dimensional array in ascending order of using BUBBLE Sort.

18 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: (c) Consider the following tables Item and Customer. Write SQL commands for the statements (i) to (iv) and give outputi for SQL queries (v) to (viii). TABLE: ITEM

I_ID ItemName Manufacturer Price PC01 Personal Computer ABC 35000 LC05 Laptop ABC 55000 PC03 Personal Computer XYZ 32000 PC06 Personal Computer COMP 37000 LC03 Laptop PQR 57000

TABLE : CUSTOMER

C_ID CustomerName City I_Id 01 N Roy Delhi LC03 06 H Singh Mumbai PC03 12 R Pandey Delhi PC06 15 C Sharma Delhi LC03 16 K Agarwal Bangalore PC01

(i) To display the details of those Customers whose City is Delhi (ii) To display the details of Items whose Price is in the range of 35000 to 55000 (Both values included) (iii) To display the CustomerNarne, City from table Customer and ItemName and Price from table Item, with their corresponding matching I_Id (iv) To increase the Price of all Items by 1000 in the table Item (v) SELECT DISTINCT City FROM Customer; (vi) SELECT ItemName, MAX(Price), Count(*) FROM Item GROUP BY ItemName;

(vii) SELECT CustomerName, Manufacturer FROM Item, Customer WHERE Item.Item_Id=Customer.ItemI_Id (viii) SELECT ItemName, Price * 100 FROM Item WHERE Manufacturer='ABC'; (c )Reduce the following Boolean expression using the K-map. (2) F(A,B,C,D)= π(0,1,2,3,4,7,8,11,12,15);

a. Write an Object Oriented C++ Program to arrange each colunm of the two dimensional array in ascending order of using BUBBLE Sort.

19 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: b. Consider the following tables STORE and SUPPLIERS a. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii).

Table: STORES

ItemNo Item Scode Qty Rate LastBuy 2005 Sharpner Classic 23 60 8 31-Jun-09 2003 Ball Pen 0.25 22 50 25 01-Feb-10 2002 Gel Pen Premium 21 150 12 24-Feb-10 2006 Gel Pen Classic 21 250 20 11-Mar-09 2001 Eraser Small 22 220 6 19-Jan-09 2004 Eraser Big 22 110 8 02-Dec-09 2009 Ball Pen 0.5 21 180 18 03-Nov-09

Table: SUPPLIERS Scode Sname 21 Premium Stationary 23 Soft Plastics 22 Tetra Supply

i) To display details of all the items in the Store table in ascending order of LastBuy. ii) To display Itemno and item name of those items from store table whose rate is more than 15 rupees. iii) To display the details of those items whose supplier code is 22 or Quantity in store is more than 110 from the table Store. iv) To display minimum rate of items for each Supplier individually as per Scode from the table Store. v) SELECT COUNT(DISTINCT Scode) FROM STORE; vi) SELECT Rate*Qty FROM STORE WHERE Itemno=2004; vii) SELECT Item,Sname FROM STORE S, SUPPLIER P WHERE S.Scode=P.Scode AND ItemNo=2006. viii) SELECT MAX(LastBuy)FROM STORE; c. Reduce the following Boolean expression using K- Map: [2] F (A, B, C, D) =  (0, 1, 2, 3, 4, 5, 10, 11, 15)

a) Define a class TEST in C++ with following description: Private Members  TestCode of type integer 20 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO:  Description of type string  NoCandidate of type integer  CenterReqd (number of centers required) of type integer  A member function CALCNTR() to calculate and return the number of centers as (NoCandidates/100+1) Public Members  A function SCHEDULE() to allow user to enter values for TestCode, Description, NoCandidate & call function CALCNTR() to calculate the number of Centres  A function DISPTEST() to allow user to view the content of all the data members.

(b) Consider the following tables ACTIVITY and COACH. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii) Table: ACTIVITY ACod ActivityName ParticipantsNum PrizeMoney ScheduleDate e 1001 Relay 100x4 16 10000 23-Jan-2004 1002 High jump 10 12000 12-Dec-2003 1003 Shot Put 12 8000 14-Feb-2004 1005 Long Jump 12 9000 01-Jan-2004 1008 Discuss 10 15000 19-Mar-2004 Throw

Table: COACH PCode Name ACode 1 Ahmad Hussain 1001 2 Ravinder 1008 3 Janila 1001 4 Naaz 1003 i. To create Activity and Coach talbes ii.To display the name of all activities with their Acodes in descending order. iii.To display the coach’s name and ACodes in ascending order of ACode from the table COACH iv. To insert a new row with values (1009, ‘Running’,8,10000,’25-Jan-2004’)

1.SELECT COUNT(DISTINCT ParticipantsNum) FROM ACTIVITY; 2.SELECT MAX(ScheduleDate),MIN(ScheduleDate) FROM ACTIVITY; 3.SELECT SUM(PrizeMoney) FROM ACTIVITY; 4. SELECT DISTINCT ParticipantNum FROM ACTIVITY; c) Reduce the following Boolean expression using K- Map: [2] F (A, B, C, D) =  (0, 1, 2, 3, 4, 5, 10, 11, 15) a) Define a class STATE in C++ with following description : Private members :  Name of state (type string)  Population (long int) 21 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO:  Number of girls under 16 years of age attending school (long int)  Total number of girls under 16 years of age (long int)  A member function CALC_PER( ) to calculate & return the percentage of girls attending the school as ( Number of girls attending the school/Total number of girls*100) Public members :  A constructor to initialize name of the state as “NOT ALLOTTED”  A function INSTATE( ) to allow user to enter data for all data members.  A function OUTSTATE( ) to allow user to view the content of all the data members along with the percentage of girls attending the school. b) Consider the following table RESORT and OWNER and answer questions (A) and (B) Table : RESORT RCODE PLACE RENT TYPE STARTDATE R101 GOA 15000 5 Star 23 Jan 2008 R102 HIMANCHAL 12000 4 Stat 12 Nov 2007 R103 KERALA 12500 5 Star 18 Mar 2006 R104 HIMANCHAL 10900 3 Star 09 Jan 2007 R105 GUJARAT 8000 2 Star 29 Apr 2008 R106 GOA 16000 7 Star 03 Mar 2003 R107 ORISSA 9600 3 Star 16 Oct 2005 R108 KERALA 12000 4 Star 12 Aug 2006 R109 HIMANCHAL 8500 2 Star 25 Jan 2004 R110 GOA 12800 4 Star 23 Feb 2008 Table : OWNEDBY PLACE OWNER GOA SUN VILLAGE KERALA KTDC HIMANCHAL KALRA RESORTS GUJARAT KINJAL GROUP ORISSA OTDC (A) Write SQL commands for the following statements: (i) to display the RCODE and PLACE of all ‘2 Star’ resorts in the alphabetical order of the place from table RESORT. (ii) to display the maximum & minimum rent for each type of resort from table RESORT. (iii) to display the details of all resorts of all TYPE . (iv) to display the owner of all ‘5 Star’ resorts from tables RESORT and OWNEDBY. (B) Give output for the following queries: (i) SELECT MIN(RENT) FROM RESORT WHERE PLACE=’KERALA’; (ii) SELECT TYPE, STARTDATE FROM RESORT WHERE TYPE=’2 Star’ ORDER BY STARTDATE; (iii) SELECT PLACE, OWNER FROM OWNEDBY WHERE PLACE LIKE ‘%L’; (iv) SELECT RCODE, RENT FROM RESORT, OWNEDBY WHERE RESORT.PLACE=OWNEDBY.PLACE AND TYPE>=’4 Star’; c) Reduce the following Boolean expression using K- Map: F(x,y,z,w)=π(0,1,3,4,5,6,7,9,10,11,13,15) Draw logic diagram. (a) Define a class Competition in C++ with the following descriptions: Private Members: Event_no integer Description char(30) 22 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: Score integer Qualified char Award(int) To award qualified as ‘Y’, if score is more than the cut off score passed as argument to the function else ‘N’. Public Members:  A constructor to assign initial values Event_No as 101, Description as “State level”, Score is 50 and Qualified as ‘N’ through parameters.  Input(), To take the input for Event_no, Description and Score and call the function Award().  Show(), To display all the details. (b)Consider the following table FLIGHT and FARES. Write the SQL commands for the statements (i) to (iv) and output from (v) to (viii). Table: FLIGHT

FL_NO DEPARTURE ARRIVAL NO_FLIGHTS NOOFSTOPS IC301 MUMBAI DELHI 8 0 IC799 BANGALORE DELHI 2 1 MC101 INDORE MUMBAI 3 0 IC302 DELHI MUMBAI 8 0 AM812 KANPUR BANGALORE 3 1 IC899 MUMBAI KOCHI 1 4 AM501 DELHI TRIVANDRUM 1 5 MU499 MUMBAI MADRAS 3 3 IC701 DELHI AHMEDABAD 4 0

Table: FARE

FL_NO AIRLINES FARE TAX% 1C701 Indian Airlines 6500 10 (i) Display Flight No, No of Flights MU499 Sahara 9400 5 arriving to the DELHI AM501 Jet Airways 13450 8 IC899 Indian Airlines 8300 4 (ii) Display all the airlines that have 1C302 Indian Airlines 4300 9 maximum no of flights. 1C799 Indian Airlines 10500 10 MC101 Deccan Airlines 3500 4 (iii) Display total fare of all the airlines.

(iv) To display departure and arrival points of flight no 1C302 and

MU499.

(v) SELECT COUNT(DISTINCT FL_NO) FROM FLIGHT;

23 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: (vi) SELECT MIN(NOOFSTOPS) FROM FLIGHT WHERE FL_NO = ‘IC899’;

(vii) SELECT AVG(FARE) FROM FARE WHRE AIRLINES = ‘Indian Airlines’;

(viii) SELECT FL_NO, NO_FLIGHTS FORM FLIGHT WHERE DEPARTURE=’MUMBAI’;

(c)Reduce the following Boolean Expression using K-Map: 2 F(U,V,W,Z)= π(0,1,2,4,5,6,8,10) a. Write an object oriented C++ program to merge the contents of two sorted arrays A & B into third array C. Assuming array A and B are sorted in ascending order and the resultant array C is also required to be in ascending order.

b. Consider the following tables STORE and SUPPLIERS a. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii).

Table: STORES

ItemNo Item Scode Qty Rate LastBuy 2005 Sharpner Classic 23 60 8 31-Jun-09 2003 Ball Pen 0.25 22 50 25 01-Feb-10 2002 Gel Pen Premium 21 150 12 24-Feb-10 2006 Gel Pen Classic 21 250 20 11-Mar-09 2001 Eraser Small 22 220 6 19-Jan-09 2004 Eraser Big 22 110 8 02-Dec-09 2009 Ball Pen 0.5 21 180 18 03-Nov-09

Table: SUPPLIERS Scode Sname 21 Premium Stationary 23 Soft Plastics 22 Tetra Supply

i. To display details of all the items in the Store table in ascending order of LastBuy. ii. To display Itemno and item name of those items from store table whose rate is more than 15 rupees. iii. To display the details of those items whose supplier code is 22 or Quantity in store is more than 110 from the table Store. iv. To display minimum rate of items for each Supplier individually as per Scode from the table Store.

v. SELECT COUNT(DISTINCT Scode) FROM STORE; vi. SELECT Rate*Qty FROM STORE WHERE Itemno=2004; vii. SELECT Item,Sname FROM STORE S, SUPPLIER P WHERE S.Scode=P.Scode AND ItemNo=2006.

24 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: viii. SELECT MAX(LastBuy)FROM STORE;

(C ) Obtain the simplified Boolean function using K –Map and draw logic diagram. 2 F( a,b,c,d)=∑( 0,1,3,5,6,7,10,14,15)

a.Define a class Travel in C++ with the description given below : Private Members : T_Code of type string Distance of type integer No_of_Adults of type integer TotalFare of type float No_of_Children of type integer Public Members : • A constructor to assign initial values as follows : T_Code with the word “NULL” Distance as 0 No_of_Adults as 0 TotalFare as 0 No_of_Children as 0 • A function AssignFare( ) which calculates and assigns the value of the data member TotalFare as follows : For each Adult Fare (Rs) For Distance (Km) 500 >=1000 300 <1000 & >=500 200 <500 For each Child the above Fare will be 50% of the Fare mentioned in the above table. For example : If Distance is 750, No_of_Adults = 3 and No_of_Children = 2 Then TotalFare should be calculated as No_of_Adults * 300 + No_of_Children * 150 i.e. 3 * 300 + 2 * 150 = 1200 • A function EnterTravel( ) to input the values of the data members T_Code, No_of_Adults, No_of_Children and Distance; and invoke the AssignFare( ) function. • A function ShowTravel( ) which displays the content of all the data members for a Travel.

b.Consider the following tables GAMES- storing the details of games and PLAYER –storing the details of players who have enrolled their names for the scheduled games. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (vi) Table: GAMES Table: PLAYER GCode GameName No_Players PrizeMoney ScheduleDate PCode PlayerName GCode 101 Carom Board 2 5000 23-Jan-2011 11 Nabi Ahmad 101 102 Badminton 2 12000 12-Apr-2011 12 Ravi Sahai 108 103 Table Tennis 4 8000 14-Feb-2011 13 Jatin 101 105 Chess 2 9000 11-Jan-2011 14 Nazneen 103

25 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO:

108 Lawn Tennis 4 25000 19-May-2011 i) To display name of those games whose PrizeMoney is in the range 10000 to 30000 and No_Players above 2. ii) To display the details of games whose GameName starts with ‘C’ in ascending order of ScheduleDate. iii) To display count of players enrolled for each game. iv) Display each PCode, PlayerName and the GameName for which they have enrolled.

v) SELECT SUM(PrizeMoney) FROM GAMES; vi) SELECT COUNT(DISTINCT GCode) FROM PLAYER;

c. Reduce Boolean Function using K-Map and draw logic diagram. 2 F( A,B,C,D)=∑(0,1,2,4,5,6,8,10)

26 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO:

A. Define a class Sports in C++ with following descriptions: Private members: S_Code of type long S_Name of type character array (String) Fees of type integer Duration of type integer Public members: Constructor to assign initial values of S_Code as 1001, S_Name as “Cricket”, Fees as 500, Duration 70 A function NewSports() which allows user to enter S_Code, S_Name and Duration. Also assign the values to Fees as per the following conditions: S_Name Fees Table Tennis 2000 Swimming 4000 Football 3000 A function DisplaySports() to display all the details. b.

(1) Write SQL commands for the following statements: (i) To display the details of all WORKERs in descending order of DOB. (ii) To display NAME and DESIG of those WORKERs, whose PLEVEL is either P001 or P002. iii)To display the content of all the WORKERs table, whose DOB is in between '19-JAN-1984' and '18-JAN- 1987'. iv)Add a new row with the following: 19, 'Daya Kishore', 'Operator', 'P003', '19-Jun-2008', '11-Jun-1984' (2) Give the output of the following SQL queries: (i) SELECT COUNT (PLEVEL), PLEVEL FROM WORKER GROUP BY PLEVEL; 27 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: (ii) SELECT MAX (DOB), MIN (DOJ) FROM WORKER; (iii) SELECT Name, Pay FROM WORKER W, PAYLEVEL P WHERE W. PLEVEL = S. PLEVEL AND P.ECODE<13 ; (iv)SELECT PLEVEL, PAY+ALLOWANCE FROM PAYLEVEL WHERE PLEVEL= 'P003' ; C) Reduce the following Boolean Expression using K-Map:F(U,V,W,Z)=(0,1,2,4,5,6,8,10) 2 a) Write an object oriented C++ program to merge the contents of two sorted arrays A & B into third array C. Assuming array A is sorted in ascending order, B is sorted in descending order, the resultant array is required to be in ascending order.

(b) Study the following tables TOUR and ACCOMODATION and write SQL commands for the questions (i) to (iv) and give outputs for SQL queries (v) to (viii). Table : TOUR SNO STUNO NAME STD JAIPUR BARMER POCKET 1 B01 Aamir XII LB MB 2000 2 B02 Salman XII MB UB 2500 3 B03 Akshay XI LB LB 2000 4 B04 Ranveer XI UB UB 1500 5 G01 Shilpa XII LB LB 2500 6 G02 Preeti XII MB UB 1500 7 G03 Rani XI UB MB 3500 Table : ACCOMODATION STUNO ROOMNO FLOOR FOOD B01 201 II Veg B02 201 II N Veg B03 202 II N Veg B04 202 II Veg G01 402 IV Veg G02 402 IV N Veg G03 403 IV Veg Note : In Stuno B stands for Boys and G stands for Girls JAIPUR refers Train to JAIPUR and BARMER refers Train to BARMER LB – Lower Berth, MB – Middle Berth, UB – Upper Berth 1.Display the details of student who got lower berth in both Jaipur and Barmer train. 2.Display the name of students whose food choice is Veg. 3.Update the food type as N Veg for girls students. 4.Display the sum of pocket money of the students standard wise. 5.select tour.stuno, name, roomno from tour, accomodation where accomodation.stuno = tour.stuno; 6.select count(pocket), sum (pocket) from tour, accomodation where tour.stuno = accomodation.stuno AND food ='Veg'; 7.select distinct roomno from accommodation;

28 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: 8.select max(pocket), min(pocket) from tour group by std;

(C ) Reduce the following Boolean Expression using K-Map: Draw logic diagram 2 F(U,V,W,Z)= π(0,1,2,4,5,6,8,10,11,13,15)

a.Define a class Society with the following specifications. Data members : Private Members : society_name char (30) house_no integer no_of_members integer flat char(10) income float Member Functions: Public members: A constructer to assign initial values of society_name as “Mahavir Nagar”, flat as “A Type”, house_no as 56, no_of_members as 6, income as 50000. input( ) – to read data members. alloc_flat( ) – To allocate flat according to income income >=500000 - Flat “ A Type” income >=250000 and income <500000 - Flat “B Type” income <250000 - Flat “ C Type” show( ) – to display all details.

b. Table : GARMENT Table : FABRIC GCODE DESCRIPTION PRICE FCODE READYDATE FCODE TYPE 10023 PENCIL SKIRT 1150 F03 19–DEC–08 F04 POLYSTER 10001 FORMAL SHIRT 1250 F01 12–JAN–08 F02 COTTON 10012 INFORMAL SHIRT 1550 F02 06–JUN–08 F03 SILK 10024 BABY TOP 750 F03 07–APR–07 F01 TERELENE 10090 TULIP SKIRT 850 F02 31–MAR–07 10019 EVENING GOWN 850 F03 06–JUN–08 10009 INFORMAL PANT 1500 F02 20–OCT–08 10007 FORMAL PANT 1350 F01 09–MAR–08 10020 FROCK 850 F04 09–SEP–07 10089 SLACKS 750 F03 20–OCT–08 (i) To display GCODE and DESCRIPTION of a each dress in descending order of GCODE. (ii) To display the details of all the GARMENTs, which have PRICE in between 1100 and 1500 (inclusive of both the dates). (iii) To display the average PRICE of all the GARMENTs, which are made up of FABRIC with FCODE as F03. (iv) To display FABRIC wise highest and lowest price of GARMENTs from DRESS table. (Display FCODE of each GARMENT along with highest and lowest price) (v) SELECT SUM (PRICE) FROM GARMENT WHERE FCODE= ‘F01’; (vi) SELECT DESCRIPTION, TYPE FROM GARMENT, FABRIC WHERE GARMENT.FCODE = FABRIC. FCODE AND GARMENT. PRICE>=1260; (vii) SELECT MAX (FCODE) FROM FABRIC; 29 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: (viii) SELECT COUNT (DISTINCT PRICE) FROM FABRIC; (c) Obtain simplified form for following Boolean expression using K-Map. (3) F(w, x, y, z) = ∑ (1, 3, 4, 5, 7, 9, 11, 12, 13, 15)

1.Write an object oriented C++ program to perform PUSH ,POP AND DISPLAY operation in a dynamically allocated stack containing name and registration number of students. Also declare the relevant structure/class and pointers.

2.Consider the following tables CUSTOMER and MOBILE. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii).

TABLE : CUSTOMER ID Cname Activation_date Validity Amount Connection (in days) 101 Preeti 04-Jun-09 365 330 Hutch 102 Sumit 12-Feb-08 60 180 Airtel 103 Aamir 14-May-09 180 250 Aircel 104 Mukul 30-Jan-08 30 100 BSNL 105 Ambani 08-Mar-07 365 310 Reliance 106 Rani 02-Apr-09 90 210 Airtel 107 Vijay 12-Sep-09 60 150 BSNL

TABLE : MOBILE ID Make Model_No 101 Nokia N76 102 LG RD3500 104 Nokia E61 105 Sony K310i 107 Motorola W756i

(i) To display the records of those customer who take the connection of BSNL or Airtel in ascending order of Activation date. (ii) To decrease the amount of all customers of Reliance connection by 500. (iii) Create a view called ITSECTOR, which contains Cname, Validity and Connection from CUSTOMER table whose Activation date is after 14-May-09. (iv) To display the ID and Cname from table Customer and Make from table Mobile, with their corresponding matching ID. (v) select Cname , Make form Customer, Mobile where Customer.ID = Mobile.ID; (vi) select Connection , sum(Amount) from Customer group by Connection ; (vii) SELECT COUNT(DISTINCT Make) FROM Mobile; . (viii) SELECT AVG(Amount) FROM Customer where Validity >= 180;

3.Simplify the following Boolean expression with the help of Karnaugh Maps (i) F(a,b,c,d)=∑(0,1,3,9,10,11,13,15)

30 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO:

a.Write an object oriented program in C++ to find the sum of diagonal elements from a 2D array of type float. (b) Consider the following tables Employee and salary. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii)

Table : Employee Eid Name Deptid Qualification Sex 1 Deepali Gupta 101 MCA F 2 Rajat Tyagi 101 BCA M 3 Hari Mohan 102 B.A M 4 Harry 102 M.A M 5 Sumit Mittal 103 B.Tech M 6 Jyoti 101 M.Tech F

Table : Salary Eid Basic DA HRA Bonus 1 6000 2000 2300 200 2 2000 300 300 30 3 1000 300 300 40 4 1500 390 490 30 5 8000 900 900 80 6 10000 300 490 89

(i) To display the frequency of employees department wise. (ii) To list the names of those employees only whose name starts with ‘H’ (iii) To add a new column in salary table . the column name is total_sal. (iv) To store the corresponding values in the total_sal column. (v) Select name from employee where eid=(select eid from salary where basic= (select max(basic) from salary)); (vi) select max(basic) from salary where bonus >40; (vii) Select count(*) from employee group by sex; (viii) select Distinct deptid from Employee; c)Reduce the following Boolean expression using K - Map : 2 F (A, B, C, D) = ∑ (0, 1, 2, 3, 4, 5, 10, 11, 15) and draw logic diagram.

31 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO:

1.Write object oriented C++ program to assign values into a 2D array of integers in the following format: If the array is 1, 2, 3, 4, 5, 6 The resultant 2D array is given below 1 2 3 4 5 6 1 2 3 4 5 0 1 2 3 4 0 0 1 2 3 0 0 0 1 2 0 0 0 0 1 0 0 0 0 0 If the array is 1, 2, 3 The resultant 2D array is given: 1 2 3 1 2 0 1 0 0 b. WORKERS DESIG W_I FIRSTNAM LASTNAM ADDRESS CITY D E E W_ID SALARY BENEFITS DESIGNATION 102 Sam Tones 33 Elm St. Paris 102 75000 15000 Manager 105 Sarah Ackerman 440 U.S. 110 New York 105 85000 25000 Director 144 Manila Sengupta 24 Friends New Delhi 144 70000 15000 Manager Street 210 75000 12500 Manager 210 George Smith 83 First Street Howard 255 50000 12000 Clerk 255 Mary Jones 842 Vine Ave. Losantiville 300 45000 10000 Clerk 300 Robert Samuel 9 Fifth Cross Washingto 335 40000 10000 Clerk n 403 32000 7500 Salesman 335 Henry Williams 12Moore Street Boston 451 28000 7500 Salesman 403 Ronny Lee 121 Harrison St. New York 451 Pat Thompson 11 Red Road Paris

I. To display the content of workers table in ascending order of first name. II. To display the FIRSTNAME, CITY and TOTAL SALARY of all Clerks from the tables workers and design, where TOTAL SALARY = SALARY + BENEFITS. III. To display the minimum SALARY among Managers and Clerks from the table DESIG. IV. Increase the BENEFITS of all Salesmen by 10% in table DESIG. V. SELECT FIRSTNAME, SALARY FROM WORKERS, DESIG WHERE DESIGNATION = ‘Manager’ AND WORKERS.W_ID = DESIG.W_ID; VI. SELECT DESIGNATION, SUM(SALARY) FROM DESIG

32 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: GROUP BY DESIGNATION HAVING COUNT(*)>=2 ; Reduce the following Boolean expression using K - Map : 2 F (A, B, C, D) = ∏ (0, 6, 8, 9, 10, 11, 13, 15)and draw logic diagram.

1.Write an object oriented C++ program to reverse the array of characters without using second array and library function. Example : if the array is having “Computer Science” Then after reversal it should rearranged as W_ID SALARY BENEFITS DESIGNATION “ecneicS retupmoC” 102 75000 15000 MANAGER 2.Consider the following tables EMPLOYEE and 105 85000 25000 DIRECTOR DESIG. Write SQL commands for the statements (i) 144 70000 15000 MANAGER to (iv) and give outputs for SQL queries (v) to (viii) 210 75000 12500 MANAGER 255 50000 12000 CLERK EMPLOYEE 300 45000 10000 CLERK 335 40000 10000 CLERK DESIG 400 32000 7500 SALESMAN W_ID FIRSTNAME LASTNAME CITY 451 28000 7500 SALESMAN 102 SAM TONES PARIS 105 SARAH ACKERMAN NEW YORK 144 MANILA SENGUPTA NEW DELHI 210 GEORGE SMITH HOWARD 255 MARY JONES HUSTON 300 ROBERT SAMUEL WASHINGTON 335 HENRY WILLIAMS BOSTON 400 RONNY LEE NEW YORK 451 PAT THOMPSON PARIS (i) Display FirstName and City of Employee having salary between 50,000 and 90,000 (ii) Display details of Employees who are from “PARIS” city. (iii) Increase the benefits of employee having W_ID = 210 by 500. (iv) Count number of employees whose name starts from character ‘S’. (v) Select MAX(salary) from desig; (vi) Select FirstName from employee, desig where designation = ‘MANAGER’ AND employee.W_ID = desig.W_ID; (vii) Select COUNT (DISTINCT designation) from desig; (viii) Select designation, SUM(salary) from desig Group by designation

33 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: Having count (*) > 2; (c )Reduce the following Boolean expression using the K-map. (2) F(A,B,C,D)= Σ(0,1,2,3,4,7,8,10,11,12,15); a) Define a class CARRENTAL in c++ with the following description: private members: CarId of type int AboutCar of type string Cartype of type string Rent of type float A member function AssignRent( ) to assign the value of Rent as per the following CArtype Rent Small 1000 Van 800 SUV 2500 public Members  A function Getcar() to allow user to enter the value for carid, Aboutcar, Cartype and call function Assignrent() to assign rent.  A function showcar( ) to allow user to view the content of all the data members. b) Given the following LAB relation: Write SQL command for the questions, (A) to (D) and give the output LAB No ItemName CostPerItem Quantity Dateofpurchase Warranty Operational 1 Computer 60000 9 21/5/96 2 7 2 Printer 15000 3 21/5/97 4 2 3 Scanner 18000 1 29/8/98 3 1 4 Camera 21000 2 13/10/96 1 1 5 Hub 8000 1 31/10/99 2 1 6 UPS 5000 5 21/5/96 1 4 7 Plotter 25000 2 11/1/2000 2 5 1. To select the ItemName, which are having the Warranty period between 2 and 4. 2. To select the ItemName, Amount of items, whose name begins with ‘P’. (Amount= CostPerItem * Quantity) 3. To list the ItemName in ascending order of the date of purchase where quantity is more than 3. 4. To display ItemName, CostPerItem, and Quantity. 5. Give the output of the following SQL commands: a. select min(DISTINCT Quantity) from LAB; b. select min(Warranty) from LAB; c. select sum(CostPerItem) from Lab; d. select ItemName from LAB where sysdate-DateofPurchase>1; c) If F(P,Q,R,S) = Σ (0,2,5,7,8,10,13,15)obtain the simplified form using K-Map. Draw logic diagram

34 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: a.Write an object oriented C++ program which accepts a 2D array of integers, number of rows and number of columns and assign the elements which are divisible by 3 or 5 into a one dimensional array of integers. 12 3 9 14 24 25 16 31 If the 2D array is   19 32 45 27   11 5 28 18 The resultant 1D arrays is 12 , 3 , 9 , 24 , 25 , 45 , 9 , 5 , 18

b.Write SQL command for (a) to (d) and write the outputs for (e) on the basis of table

Table : CLUB COACH- COACHNAME AGE SPORTS DATOFAPP PAY SEX ID 1 KUKREJA 35 KARATE 27/03/1996 1000 M 2 RAVINA 34 KARATE 20/01/1998 1200 F 3 KARAN 34 SQUASH 19/02/1998 2000 M 4 TARUN 33 BASKETBALL 01/01/1998 1500 M 5 ZUBIN 36 SWIMMING 12/01/1998 750 M 6 KETAKI 36 SWIMMING 24/2/1998 800 F 7 AMKITA 39 SQUASH 20/02/1998 2200 F 8 ZAREEN 37 KARATE 22/02/1998 1100 F 9 KUSH 41 SWIMMING 13/01/1998 900 M 10 SHAILYA 37 BASKETBALL 19/02/1998 3700 M i. To show all information about the swimming coaches in the club. ii. To list names of all coaches with their data of appointment (DATOFAPP) in descending order. iii. To display a report, showing coach name, pay, age and bonus (15% of pay) for all coaches. iv. To insert a new record in the CLUB table with the following data: 11,”Rajender”,25,”Football”,{27/05/2004},4500,”M” v. give the output of the following SQL statements: a) Select count(distinct SPORTS) from CLUB; b) Select min(AGE) from CLUB where SEX=’F’; c) Select AVG(PAY) from CLUB where SPORTS=’KARATE’; d) Select SUM(PAY) from CLUB where DATOFAPP>{31/01/98}; c)Reduce the following Boolean Expression using K-Map: 2 F(U,V,W,Z)= ∑(0,1,2,4,5,6,8,10,12,14) 35 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: a. Define functions stackpush( ) to insert nodes and stackpop ( ) to delete nodes, for a linked list implemented stack having the following structure for each node. struct ticket { long ticketno; char name[40]; }; Write complete program and necessary declarations

(b) Consider the following table DRESS and MATERIAL. Write SQL commands for the statements (i) to (iv) and give outputs for SQL quarries (v) to (viii).

Table: DRESS TABLE: MATERIAL

DCODE DESCRIPTION PRICE MCODE LAUNCHDATE 10001 Formal Shirt 1250 M001 12-JAN-08 MCODE TYPE 10020 FROCK 750 M004 09-SEP-07 M001 TERELENE 10012 INFORMAL SHIRT 1450 M002 06-JUN-08 M002 COTTON 10019 EVENING GOWN 850 M003 06-JUN-08 M004 POLYESTER 10090 TULIP SKIRT 850 M002 31-MAR-07 M003 SILK 10090 PENCIL, SKIRT 1250 M003 19-DEC-08 10023 SLACKS 850 M003 20-OCT-08 10089 FORMAL PANT 1450 M001 09-MAR-08 10009 INFORMAL PANT 1400 M002 20-OCT-08 10024 BABY TOP 650 M003 07-APR-07

(i) To display DCODE and DESCRIPTION of each dress in ascending order of DCODE. (ii) To display the details of all the dresses which have LAUNCHDATE in between 05-DEC-07 and 20-JUN-08 (inclusive of both the dates) (iii) To display the average PRICE of all the dresses which are made up of material with MCODE as M003. (iv) To display material wise highest and lowest price of dresses from DRESS table. (Display MCODE of each dress along with highest and lowest price) . (v) SELECT SUM( PRICE) FROM DRESS WHERE MCODE= ‘M001’; (vi) SELECT DESCRIPTION , TYPE FROM DRESS MATERIAL WHERE DRESS.DCODE>=1250; (vii) SELECT MAX(MCODE) FROM MATERIAL ; (viii) SELECT COUNT(DISTINCT PRICE) FROM DRESS. (c)Obtain a simplified form for a Boolean expression 2 F(x,y,z,w)=∑(0,1,3,4,5,6,7,9,10,11,13,15) using Karnaugh map. Draw logic diagram.

36 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: (a) Write a function TRANSFORM( ) in C++ to swap the elements of first and last row. Write complete Object Oriented C++ program for the above question. Ex.If the two dimensional array contains, After swapping of the content

2 1 4 9 1 3 7 7 5 8 6 3 7 2 1 2

B.Given the following tables for a database library. Write sql queries for (i) to (vi): BOOKS: book_id book_name author_name publishers price type qty. k0001 Sanjeev & sanjeev Sanjeev EPB 755 Cookery 15 p0001 Genuine Sanjay mukharjee FIRST PUBL. 1650 Fiction 20 m0001 Mastering c++ J. Mukhi EPB 350 Text 89 n0002 Vc++ advance Kanetkar TDH 150 Text 78 k0002 Near to heart P. Purohit FIRST PUBL. 2341 Fiction 16

TABLE : ISSUED book_id quantity_issued

k0002 4 p0001 5 m0001 2 i. To show book name, author name and price of books of first publ. Publishers. ii. To list the names from books of text type. iii. To display the names and price form books in ascending order of their price. iv. To increase the price of all books of epb publishers by 50. v. To display the book_id,book_name and quantity_issued for all books which have been issued.(the query will require contents from both the tables.) vi. To insert a new row in the table issued having the following data : “n0002 ”, 16 vii. Give the output of the following queries based on the above tales: a. select count(*)from books; b. select max(price) from books where quantity>=15; c. Select book_name,author_name from books where publishers = “epb”; d. Select count (distinct publishers) from books where price>=400; c)Reduce the following Boolean Expression using K-Map: F(U,V,W,Z)= π(0,1,2,3,4,5,6,7,8,10,11) 2

(a) Write an Object Oriented C++ program to take a two dimensional array A, with size N rows and N columns and point the upper half of the array. eg. If A is

37 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: 2 3 1 5 0 2 3 1 5 0 7 1 5 3 1 1 5 3 1 2 5 7 8 1 The Output Will be 7 8 1 0 1 5 0 1 0 1 3 4 9 1 5 5

b.Consider the following tables Stationary and Consumer. Write SQL commands for the statement (i) to (iv) and output for SQL queries (v) to (viii): Table: Stationary S_ID StationaryName Company Price DP01 Dot Pen ABC 10 PL02 Pencil XYZ 6 ER05 Eraser XYZ 7 PL01 Pencil CAM 5 GP02 Gel Pen ABC 15

Table: Consumer C_ID ConsumerName Address S_ID 01 Good Learner Delhi PL01 06 Write Well Mumbai GP02 12 Topper Delhi DP01 15 Write & Draw Delhi PL02 16 Motivation Banglore PL01

(i) To display the details of those consumers whose Address is Delhi. (ii) To display the details of Stationary whose Price is in the range of 8 to 15. (Both Value included) (iii) To display the ConsumerName, Address from Table Consumer, and Company and Price from table Stationary, with their corresponding matching S_ID. (iv) To increase the Price of all stationary by 4. (v) SELECT DISTINCT Address FROM Consumer; (vi) SELECT Company, MAX(Price), MIN(Price), COUNT(*) from Stationary GROUP BY Company; (vii) SELECT Consumer.ConsumerName, Stationary.StationaryName, Stationary.Price FROM Strionary, Consumer WHERE Consumer.S_ID=Stationary.S_ID; (viii) Select StationaryName, Price*3 From Stationary;

(c)Obtain a simplified form for a Boolean expression 2 F(x,y,z,w)=π(0,1,3,4,5,6,7,9,10,11,13,15) using Karnaugh map. Draw logic diagram. a. Write an Object Oriented C++ program to swap (interchange) the first column elements with the last column elements for a two dimensional integer array.

Ex.If the two dimensional array contains, After swapping of the contents it should be

38 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: 2 1 4 9 1 3 7 7 5 8 6 3 7 2 1 2

b.Consider the following tables TEACHER and TEACHSALARY and answer (b1) and (b2) parts of this question.

Table: TEACHER TEACHSALARY

TID FIRSTNAME LASTNAME ADDRESS SUBJECT TID SALARY BONUS DESIGNATION 010 Rohit Sharma 83 Lok vihar English 010 7500 1500 PGT 105 Meena Rathi 842 Rajouri Garden Physics 105 8500 1500 PGT 152 Seema Verma 33 Safdarjung Maths 152 600 1200 TGT 215 Sarad Singh 440 Ashok Vihar Physics 215 7500 1500 TGT 144 Manish Sengupta 24 New Street Maths 144 5000 1000 PRT 300 Ram Gupta 9 Fifth Road Chemistry 300 4500 1000 PRT 335 Heena Jain 12 Friends Street Computer 335 4000 1000 PRT 400 Rachit Sharma 12 Pachim Vihar Computer 400 6500 1200 TGT 441 Puneet Jain 11 Roshni Chemistry 441 7800 1500 PGT

(b1) Write SQL commands for the statements (i) to (iv).

i. To display Firstname, Lastname and Subject of all teachers having subject Physics. ii. To display the content of Teachers table in ascending order of LASTNAME. iii. To display the TID, Firstname and Total Salary of all PGT from table TEACHER and TEACHSALARY, where Total Salary is calculated as Salary + Bonus. iv. To display the sum of salary of all the PRT Teachers.

(b2) Give the output of the following SQL queries v to viii: v. SELECT FIRSTNAME, SALARY FROM TEACHER, TEACHSALARY WHERE DESIGNATION =”PGT” AND TEAHER.TID=TEACHSALARY.TID; vi. SELECT DISTINCT DESIGNATION FROM TEACHSALRY; vii. SELECT DESIGNATION, MAX(SALRY) FROM TEACSALRY GROUP BY DESIGNATION; viii. SELECT SUM(BONUS) FROM TEACHSALRY WHERE DESIGNATION=”PGT”;

(c)Obtain a simplified form for a Boolean expression 2 F(x,y,z,w)=∑(0,1,3,4,5,6,7,10,12,13,15) using Karnaugh map. Draw logic diagram. a.Write an Object Oriented C++ program to search for a given city in a list of cities present in an array which is in alphabetical order using Binary search method.

b) Consider the following tables SCHOOL and ADMIN. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii). SCHOOL CODE TEACHERNAME SUBJECT DOJ PERIODS EXPERIENCE 1001 RAVI SHANKAR ENGLISH 12/03/2000 24 10 1009 PRIYA RAI PHYSICS 03/09/1998 26 12 39 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: 1203 LISA ANAND ENGLISH 09/04/2000 27 5 1045 YASHRAJ MATHS 24/08/2000 24 15 1123 GANAN PHYSICS 16/07/1999 28 3 1167 HARISH B CHEMISTRY 19/10/1999 27 5 1215 UMESH PHYSICS 11/05/1998 22 16 ADMIN CODE GENDER DESIGNATION 1001 MALE VICE PRINCIPAL 1009 FEMALE COORDINATOR 1203 FEMALE COORDINATOR 1045 MALE HOD 1123 MALE SENIOR TEACHER 1167 MALE SENIOR TEACHER 1215 MALE HOD [ i) To display TEACHERNAME, PERIODS of all the teachers whose periods are less than 25 in ascending order of teacher name . ii) To display TEACHERNAME, CODE and DESIGNATION from tables SCHOOL and ADMIN. iii) To display the subject wise TEACHERNAME who have minimum PERIODS. iv) To display CODE, TEACHERNAME and SUBJECT of all teachers who have joined the school after 01/01/1999. v) select max(experience), subject from school group by subject; vi) select teachername, gender from school, admin where designation = ‘coordinator’ and school.code=admin.code ; vii) select designation, count(*) from admin group by designation having count(*) <3; ix) select count(distinct subject) from school; c) Obtain a simplified form for a Boolean expression 2 F(P,Q,R,S)=∑(0,1,2,4,6,8,9,10,11,14,15) using Karnaugh map. Draw logic diagram.

a) Define a class CRICKET in C++ with the following description: Private members:  Target_score of type integer  Overs_bowled of type integer  Extra_time of type integer  Penalty of type integer  Cal_penalty() a member function to calculate penalty as follows: If extra_time<=10, penalty=1 If extra_time>10 but <=20 penalty=2, otherwise, penalty=5

40 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: Public members:  A fuinction Extradata () to allow user to enter values for target_score, over_bowled, Extra_time.  A function DspData( ) to allow user to view the contents of all data members. B.Write SQL commands for (a) to (f) and write the output of the (g) on the basis of the table

SUPPLIER. S# PName SName Qty Price City S1 Bread Britannia 150 8.00 Delhi S2 Cake Britannia 250 20.00 Mumbai S3 Coffee Nescafe 170 45.00 Mumbai S4 Chocolate Amul 380 10.00 Delhi S5 Sauce Kissan 470 36.00 Jaipur S6 Maggi Nestle 340 10.00 Kolkata S7 Biscuit Marie 560 21.00 Chennai S8 Jam Kissan 220 40.00 Delhi S9 Pizza 345 5.00 Kolkata i. Display data for all products whose quantity is between 170 and 370. ii. Display data for all products sorted by their quantity.

iii. Find all the products that have no supplier.

iv. Give SName for that entire product whose name starts with “C”.

v. To list SName, PName, Price for all the products whose quantity is <200.

vi. To display S#, PName, SName, Qty in reverse order of qty from the SUPPLIER table. vii. Give the output of the following SQL commands: a. Select AVG(Price) from SUPPLIER where Price < 30; b. Select MAX(Price) from SUPPLIER where Price > 30; c. Select SUM(Price * Qty) from SUPPLIER where Qty < 10; d. Select COUNT(DISTINCT City) from SUPPLIER;

C.Obtain a simplified form for a Boolean expression 2 F(a,b,c,d)=∑(1,2,3,4,5,6,7,9,10,11,12,13) using Karnaugh map. Draw logic diagram.

1.Define a class Candidate in C++ with following description: Private Members _ A data member RNo (Registration Number) of type long _ A data member Name of type string _ A data member Score of type float _ A data member Remarks of type string

41 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: _ A member function AssignRem( ) to assign Remarks as per the Score obtained by a candidate. Score range and the respective Remarks are shown as follows: Score Remarks >=50 Selected less than 50 Not selected Public Members _ A function ENTER ( ) to allow user to enter values for RNo, Name,Score & call function AssignRem( ) to assign the remarks. _ A function DISPLAY ( ) to allow user to view the content of all the data members.

2.Write SQL commands for (a) to (f) and write the output of the (g) on the basis of the table SUPPLIER. S# PName SName Qty Price City S1 Bread Britannia 150 8.00 Delhi S2 Cake Britannia 250 20.00 Mumbai S3 Coffee Nescafe 170 45.00 Mumbai S4 Chocolate Amul 380 10.00 Delhi S5 Sauce Kissan 470 36.00 Jaipur S6 Maggi Nestle 340 10.00 Kolkata S7 Biscuit Marie 560 21.00 Chennai S8 Jam Kissan 220 40.00 Delhi S9 Pizza 345 5.00 Kolkata b. Display data for all products whose quantity is between 170 and 370. c. Display data for all products sorted by their quantity.

d. Give SName for that entire product whose name starts with “C”. e. To list SName, PName, Price for all the products whose quantity is <200. f. To display S#, PName, SName, Qty in reverse order of qty from the SUPPLIER table. g. Give the output of the following SQL commands: 1. Select AVG(Price) from SUPPLIER where Price < 30; 2. Select MAX(Price) from SUPPLIER where Price > 30; 3. Select SUM(Price * Qty) from SUPPLIER where Qty < 10; 4. Select COUNT(DISTINCT City) from SUPPLIER;

3. Reduce the following Boolean Expression using K-Map : 2 F(U,V,W,X) = ∑ (0,1,3,4,7,8,11,12,15)

1.Write an object oriented C++ program to find the sum of all the positive and even numbers stored in a two dimensional array.

(2) Consider the following relation TEACHER and SALARY. Write SQL commands for the statement (i) to (iv) and output from (v) to (viii). TABLE: TEACHER

42 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: TID FIRST_NAME LAST_NAME ADDRESS SUBJECT 010 Rohit Sharma 83, Lok Vihar English 105 Meeta Rathi 842, Rajauri Garden Physics 152 Seema Verma 33, Safdarganj Maths 215 Sarad Singh 440, Ashok Vihar Physics 244 Manish Sengupta 24, New Street Maths 300 Ram Gupta 9, Fifth Road Chemistry 355 Heena Jain 12, Friends Street Computer 400 Rachit Sharma 10, Paschim Vihar Computer 441 Punit Jain 11, Rohini Chemistry

TABLE: SALARY TID SARARY BONUS DESIGNATION 010 7500 1500 PGT 105 8500 1500 PGT 152 6000 1200 TGT 215 7500 1500 PGT (i) To display FIRST_NAME, LAST_NAME and SUBJECT of all teachers of PHYSICS subject (ii) To display all records in ascending order of LAST_NAME. (iii) To display the TID, FIRST_NAME and total SALARY of all PGT from the table TEACHER and SALARY, where total salary is calculated as SALARY + BONUS. (iv) To display the ADDRESS of teachers SUBJECT wise. (v) SELECT FIRST_NAME, SALARY FROM TEACHER, SALARY WHERE DESIGNATION=”TGT” AND TEACHER.TID = SALARY.TID; (vi) SELECT DISTINCT(DESIGNATION), MAX (SALARY) FROM SALARY (vii) SELECT FIRST_NAME, ADDRESS FROM TEACHER WHERE FIRST_NAME LIKE ‘S%’; (viii) SELECT SUM (BONUS) FROM SALARY WHERE DESIGNATION=’PGT’;

3.Reduce the following Boolean Expression using K-Map : 2 F(U,V,W,X) = ∏ (0,1,3,4,7,8,11,12,15) a) Consider the class: class QUEUE { private: int data[100], front, rear; public: QUEUE( )

43 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: { front=rear=-1; } void INSQ( ); //to insert an element into queue after checking the overflow condition void DELQ( ); //to delete an element from the queue after checking empty queue void PRINTQ( ); //to print the current status of queue after checking empty queue }; Complete the definition of functions INSQ( ) , DELQ( ) and PRINTQ() of above class.Write C++ programe. (b) Consider the following tables FACULTY and COURSES. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii) FACULTY COURSES F_ID Fname Lname Hire_date Salary C_ID F_ID Cname Fees 102 Amit Mishra 12-10-1998 12000 C21 102 Grid Computing 40000 103 Nitin Vyas 24-12-1994 8000 C22 106 System Design 16000 104 Rakshit Soni 18-5-2001 14000 C23 104 Computer Security 8000 105 Rashmi Malhotra 11-9-2004 11000 C24 106 Human Biology 15000 106 Sulekha Srivastava 5-6-2006 10000 C25 102 Computer Network 20000 107 Niranjan Kumar 26-8-1996 16000 C26 105 Visual Basic 6000 C27 107 Dreamweaver 4000 (i) To display details of those Faculties whose date of joining is before 31-12-2001. (ii) To display the details of courses whose fees is in the range of 15000 to 50000 (both values included). (iii) To increase the fees of Dreamweaver course by 500. (iv) insert new column in a COURSES named Level with String type.. (v) Select COUNT(DISTINCT F_ID) from COURSES; (vi) Select MIN(Salary) from FACULTY,COURSES where COURSES.F_ID =FACULTY.F_ID; (vii) Select SUM(Fees) from courses Group By F_ID having count(*) > 1; (ix) Select Fname, Lname from FACULTY Where Lname like “M%”;

(c )Reduce the following Boolean expression using K-Map: 2 F(A,B,C,D) = π(0,1,4,5,8,10,12,14,15) 1.Write a function in C++ which accepts an integer array and its size as arguments / parameters and arrange all the odd numbers in the first row and even numbers in the second row of a two dimensional array. The unused cells of two dimensional array must be filled with 0. If the array is 1, 2, 3, 4, 5, 6 The resultant 2-D array is given below 1 3 5 0 0 0 0 0 0 6 4 2

44 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: (2) Consider the tables ITEMS & COMPANY. Write SQL commands for the statements (i) to (iv) and give the outputs for SQL queries (v) & (vi) .

Table : ITEMS ID PNAME PRICE MDATE QTY T001 Soap 12.00 11/03/2007 200 T002 Paste 39.50 23/12/2006 55 T003 Deodorant 125.00 12/06/2007 46 T004 Hair Oil 28.75 25/09/2007 325 T005 Cold Cream 66.00 09/10/2007 144 T006 Tooth Brush 25.00 17/02/2006 455

Table : COMPANY ID COMP City T001 HLL Mumbai T006 Colgate Delhi T009 HLL Mumbai T007 Paras Haryana T005 Ponds Noida T0011 Wipro Ahmedabad

i) Display the items detail produced by Wipro & Paras.

ii) To display product name, company name & price for those items which IDs are equal to the IDs of company. iii) To delete the items produced before 2007.

iv) To display the total stock value of items. v) SELECT COUNT(*) FROM ITEMS WHERE ITEMS.ID=COMPANY.ID; vi) SELECT PNAME.MDATE FROM ITEMS WHERE PRICE=SELECT MIN(PRICE) FROM ITEMS; (c )Reduce the following Boolean expression using the K-map. (2) F(A,B,C,D)= Σ(0,1,3,4,7,8,11,12,15);

(a) Write an object oriented program in C++ which accepts an integer array and its size as arguments / parameters and arrange all the odd numbers in the first row and even numbers in the second row of a two dimensional array as follows. The unused cells of two dimensional array must be filled with 0. If the array is 1, 2, 3, 4, 5, 6 The resultant 2-D array is given below

45 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: 1 3 5 0 0 0 0 0 0 6 4 2 b) Consider the following tables Customer_Record and Order_Detail. Write SQL commands for statements (i) to (iv) and give output for SQL queries (v) to (viii) 6 Table: Customer_Record C_Code Name City Phone C001 Raju Patna 6837282 C002 Ali New Delhi 6763522 C003 James Patna 6912345 C004 Hari New Delhi 6354627 C005 Toms New Delhi 6644533 Table: Order_Detail O_Code C_Code Date Item Qty Amount A001 C003 23-Nov-07 Burger 3 60 A002 C002 25-Nov-07 Pizza 2 300 A003 C005 30-Nov-07 Burger 5 100 A004 C004 03-Dec-07 Burger 5 100 A005 C001 15-Dec-07 Hot Dog 2 40 (i) To display the name of all customers from Patna. (ii) To display C_Code, Name, Item, Qty and Amount for every customer. (iii) To display Customer Detail in descending order of customer name. (iv) To display City and number of customers from each city. (v) Select count (distinct city) from Customer_Record; (vi) Select A.name, B.item from customer_record A, order_detail b where a.c_code=b.c_code and a.city = ’New Delhi’; (vii) Select O_code, c_code, qty, amount from order_detail where item not in (‘Pizza’, Hot Dog’); (viii) Select item, qty, o_code from order_detail where amount=60 or amount=40; c) Reduce the following Boolean expression using K-Map: 2 F(A,B,C,D) = Σ(0,1,4,5,8,10,12,14,15) (a) Write an object oriented program in C++ which accepts and its prints no of even numbers and odd numbers in each column of a 2-D array of integers.

If the array is 11 12 31 41 52 62 71 82 9 10 11 12 The output will be Column 1: Even numbers : 1 Odd numbers : 2 46 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: Column 2: Even numbers : 3 Odd numbers : 0 Column 3: Even numbers : 0 Odd numbers : 3 Column 4: Even numbers : 2 Odd numbers : 1 (b)Consider the following tables Client and Bill. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii) (6) Table : Client Cust_Id Cust_Name Address Phone_n City o C007 Pritam Sharma 12,M.G Road 71274250 Bangalore C008 Sutopa 14/1 Pritam Pura 41206819 Delhi C010 Anurag Basu 15A, Park Road 61281921 Kolkata C012 Hrithik 7/2 Vasant Kunj 26121949 Delhi C013 Firoz Shah 2, Servamali road 25014192 Bangalore C025 Vinod Nagpal 46-a Navi Mumbai 64104944 Mumbai C027 Sameer 41,Dwarka 42101619 Delhi C002 Pasunjit Bose 16/A K.G Marg 27220012 Bangalore C035 Aamina Begum 13/A Versova 41612181 Mumbai Table : BILL Ord_id Cust_id Item Ord_date Qty Price 7002 C007 Pizza 20-11-07 1 249.50 7003 C013 Garlic 24-10-05 3 75.75 Bread 7004 C012 Pasta 03-03-07 4 173.00 7005 C010 Ice Cream 01-01-08 30 195.75 7006 C035 Pizza 02-03-06 4 249.50 7009 C035 Garlic 02-03-08 2 75.75 Bread 7010 C013 Brownie 04-05-07 4 40.50 7011 C014 Ice Cream 02-06-08 5 195.75 7012 C002 Pizza 01-02-08 7 249.50

i. Display a report containing cust_id, cust_name, Item,qty,price and bill amount. Bill amount is calculated as the sum of qty*price ii. Display how many customers have ordered Pizza in the month of March. iii. Count the number of customer who have ordered item worth more than 1700. Total amount = sum of qty* price iv. Display the name of customer along with their city in alphabetical order of city v. select Cust_name , City, ord_date from Client A, Bill b Where A.Cust_id =b.Cust_id; vi. select Cust_name from Client where Cust_id=( Select Cust_id from Bill where Year(ord_date) =2008)

47 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: vii. select count(*) from Client group by City; viii. select Distinct (Item) from Bill; (c) Obtain the simplified form of the Boolean Expression using K’ Map: F( x , y , z, w) = ∑ (0,2,4,5,8,9,12,13,15)

1.Write an object oriented C++ program to reverse each row of a 2D array of integers.

2. Given below following table OFFICE. Write SQL queries for (i)-(iv) and give output for (vi)-(viii). (8*1/2=4) Empno Empname Age Department Sex B_Pay 1 Ankit 45 Comp.Sc. M 10000 2 Sumit 32 History M 6000 48 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: 3 Suchitra 23 Maths F 9000 4 Amit 25 Geography M 5000 5 Ankita 26 Hindi F 8500 6 Shurti 28 Comp.Sc. F 7200 7 Rakesh 35 Hindi M 5900 8 Priya 33 History F 10500

1. Display details of all employees belonging to History and Geography department. 2. Display average age of employee department wise. 3. Display number of employees in each department where number of employees are more than of equal to 2. 4. Display details of all female employee belonging to various departments except in Maths and History. 5. Display name and age of those employees getting basic pay between 6000 and 10000. 6. Select sum(B_pay) from OFFICE; 7. Select count (*) from OFFICE where name like ‘A%’; 8. Select empname from OFFICE where age in (select max(age) from OFFICE); 3. Reduce the following Boolean expression using K- Map: [2] F (A, B, C, D) = π (0, 1, 2, 3, 4, 5, 10, 11, 15)

49 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO:

b b. Write SQL commands for i) to iv) and the outputs for v) on the basis of tables MOVIES 6 MOVIES

No Title Type Rating Star Qty Price 1 Australia Comedy G Nicole Kidman 4 35.95 2 The Reader Comedy R Jason 2 69.95

3 The Dark Knight Action PG Heath Ledger 7 49.95

4 Slum Dog Millionaire Drama G Anil Kapoor 3 29.95

5 Frost/Nixon Drama R Frank Langella 3 19.95

6 The Curious Case of Benjamin Button Drama G David Fincher 2 44.95

7 Revolutionary Road Drama PG Kate Winslet 2 31.95

8 Crocodile Business Comedy PG13 Harris 2 69.95

9 Michael Clayton Action R George Clooney 3 99.95

10 No Country for Old Men Action R Javier Bardem 1 29.95

i) Display a list all movies with Price over 20 and sorted by Price. ii) Display all the movies sorted by QTY in decreasing order. iii) Display a report listing a Title, current price and replacement value for each movie as Qty * Price * 1.15 iv) Display all the movies and their price whose type is Drama. v) Give the outputs for the following statements. a) SELECT AVG(Price) FROM MOVIES WHERE Price < 30; b) SELECT MAX(Price) FROM MOVIES WHERE Price > 30; c) SELECT SUM(Price * Qty) FROM MOVIES WHRE Qty < 4; d) SELECT COUNT(DISTINCT TYPE) FROM MOVIES; c.Reduce the following Boolean Expression using K-Map : F(U,V,W,X) = ∏ (0,1,3,4,7,8,11,12,15) 2 A. Define a class REGFLAT in C++ with following description : Private members : a. registration number of type integer (range 200-500) b. Name of type string c. Flat type string d. Cost of type float Public members :  A function INFLAT( ) to read an object of REGFLAT type  A function OUTFLAT( ) to allow user to view the content of all the data members.

50 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO:  A function DRAW( ) to choose & display the details of 5 houses selected randomly from an array of 10 objects of type REGFLAT passed as arguments to the function. Use random function to generate the registration numbers to match with registration number from the array. B. Consider the following tables FACULTY and COURSES. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii) C_ID F_ID Cname Fees C21 102 Grid Computing 40000 FACULTY C22 106 System Design 16000 COURSES C23 104 Computer Security 8000 C24 106 Human Biology 15000 F_ID Fname Lname Hire_date Salary C25 102 Computer Network 20000 102 Amit Mishra 12-10-1998 12000 C26 105 Visual Basic 6000 103 Nitin Vyas 24-12-1994 8000 C27 107 Dreamweaver 4000 104 Rakshit Soni 18-5-2001 14000 105 Rashmi Malhotra 11-9-2004 11000 106 Sulekha Srivastava 5-6-2006 10000 107 Niranjan Kumar 26-8-1996 16000

(i) To display details of those Faculties whose date of joining is before 31-12-2001. (ii) To display the details of courses whose fees is in the range of 15000 to 50000 (both values included). (iii) To increase the fees of Dreamweaver course by 500. (iv) To display F_ID, Fname, Cname of those faculties who charged more than15000 as fees. (v) Select COUNT(DISTINCT F_ID) from COURSES; (vi) Select MIN(Salary) from FACULTY,COURSES where COURSES.F_ID = FACULTY.F_ID; (vii) Select SUM(Fees) from courses Group By F_ID having count(*) > 1; (viii) Select Fname, Lname from FACULTY Where Lname like “M%”;

C. Reduce the following Boolean Expression using K-Map [2] F(A,B,C,D) = ∑( 0 , 2,3, 4, 5, 6, 7, 8, 11, 13, 15) i.Write an object oriented C++ program to read an array of n integers, find maximum integer m and make a 2D array of dimension nXm from it. If input array is A[]= { 0,1,2,4,5,6,7,10} output X[10][10]= 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 2 2 0 0 0 0 0 0 0 0 4 4 4 4 0 0 0 0 0 0 5 5 5 5 5 0 0 0 0 0 6 6 6 6 6 6 0 0 0 0 7 7 7 7 7 7 7 0 0 0 51 10 10 10 10 10 10 10 10 10 10 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO:

(a) Consider the following tables Customer_Record and Order_Detail. Write SQL commands for statements (i) to (iv) and give output for SQL queries (v) to (viii) Table: Customer_Record Table: Order_Detail C_Code Name City Phone O_Code C_Code Date Item Qty Amount C001 Raju Patna 6837282 A001 C003 23-Nov- Burger 3 60 C002 Ali New Delhi 6763522 07 C003 James Patna 6912345 A002 C002 25-Nov- Pizza 2 300 C004 Hari New Delhi 6354627 07 C005 Toms New Delhi 6644533 A003 C005 30-Nov- Burger 5 100 07 (ix) To display the name of all A004 C004 03-Dec-07 Burger 5 100 customers from Patna. A005 C001 15-Dec-07 Hot Dog 2 40 (x) To display C_Code, Name, Item, Qty and Amount for every customer. (xi) To display Customer Detail in descending order of customer name. (xii) To display City and number of customers from each city. (xiii) Select count (distinct city) from Customer_Record; (xiv) Select A.name, B.item from customer_record A, order_detail b where a.c_code=b.c_code and a.city = ’New Delhi’; (xv) Select O_code, c_code, qty, amount from order_detail where item not in (‘Pizza’, Hot Dog’); (xvi) Select item, qty, o_code from order_detail where amount=60 or amount=40;

d) F (a, b , c, d) = ∏ ( 0, 1, 3, 4, 5, 6, 7, 9, 10, 11, 13, 15) using Karnaugh Map.

(a) Write a function in C++ which accepts an integer array and its size as arguments and rearranges the array such that each half of the array is reversed. Example: if an array of ten elements initially contain 4, 2, 5, 1, 6, 7, 8, 12, 10 ,15 Then the function should rearrange the array as 6, 1, 5, 2, 4, 15, 10, 12, 8, 7 If an array of nine elements initially contain 4, 2, 5, 1, 6, 7, 8, 12, 10

52 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: Then the function should rearrange the array as 1, 5, 2, 4, 6, 10, 12, 8, 7

(b) Reduce the following Boolean Expression using K-Map: 3 F(A,B,C,D)=(0,1,2,4,5,6,8,10,11,14,15)

Write a function in C++ which accepts an integer array and its size as arguments/parameters and assign the elements into a two dimensional array of integers in the following format (size must be odd) (3) If the array is 1 2 3 4 5 If the array is 10 15 20 The output must be The output must be 1 0 0 0 5 10 0 20 0 2 0 4 0 0 15 0 0 0 3 0 0 10 0 20 0 2 0 4 0 1 0 0 0 5

Define a class PhoneBill in C++ with the following descriptions. (4) Private members: CustomerName of type character array PhoneNumber of type long No_of_units of type int Rent of type int Amount of type float. calculate( ) This member function should calculate the value of amount as Rent+ cost for the units. Where cost for the units can be calculated according to the following conditions. No_of_units Cost First 50 calls Free Next 100 calls 0.80 @ unit Next 200 calls 1.00 @ unit Remaining calls 1.20 @ unit Public members: * A constructor to assign initial values of CustomerName as “Raju”, PhoneNumber as 259461, No_of_units as 50, Rent as 100, Amount as 100. * A function accept( ) which allows user to enter CustomerName, PhoneNumber,No_of_units And Rent and should call function calculate( ).

53 KENDRIYA VIDYALAYA DRDO COMPLEX C.V.RAMAN NAGAR BANGALORE 93 MODEL AISSCE PRACTICAL EXAMINATION QUESTIONS 2015-16 SUBJECT : COMPUTER SCIENCE CODE: 083 MAX MARKS:30 TIME: 3 Hours CBSE ROLL NO: * A function Display( ) to display the values of all the data members on the screen.

54

Recommended publications