#1
June 14th, 2014, 05:09 PM
| |||
| |||
CBSE Class 12 Computer Science Exam Question Papers
Will you please like to share the previous year question paper of CBSE Class 12 Computer Science Exam??? Here I am sharing the previous year question paper of CBSE Class 12 Computer Science Exam QUESTION PAPER CODE 91/1 1. (a) What is the difference between Local Variable and Global Variable? Also, give a suitable C++ code to illustrate both. 2 (b) Write the names of the header files, which is/are essentially required to run/ execute the following C++ code: void main ( ) { char C, String [ ] = "Excellence Overload"; for (int I=0; String [ I ] ! = '\ 0'; I ++ ) if (String [I] ==' ') cout<<end1; else { C=toupper(String[I]); cout<<C ; } } (c) Rewrite the following program after removing the syntactical errors (if any). Underline each correction. 2 #include[iostream.h] typedef char Text(80) ; void main ( ) { Text T= "Indian"; int Count=strlen(T) ; cout<<T<<'has'<<Count<< 'characters' <<end1; } (d) Find the output of the following program: 3 #inc1ude<iostream.h> void ChangeArray(int Number, int ARR[ ], int Size) { for (int L =0; L<Size; L++) if (L<Number) ARR [L] +=L; e1se ARR [L] *=L; } void Show (int ARR [ ], int Size) { for (int L=0; L<Size; L++) (L%2!=0) ?cout<<ARR[L] <<"#": cout<<ARR[L]<<end1 ; } void main ( ) { int Array [ ] = {30, 20, 40, 10, 60, 50}; ChangeArray (3, Array, 6) ; Show (Array, 6) ; } (e) Find the output of the following program: 2 #include<iostream.h> void main ( ) { int Track [ ] = {10, 20, 30, 40}, *Striker ; Stxiker=Track : Track [1] += 30 ; cout<<"Striker>"<<*Striker<<end1 ; Striker – =10 ; Striker++ ; cout<<"Next@"<<*Striker<<end1 ; Striker+=2 ; cout<<"Last@"<<*Striker<<end1 ; cout<< "Reset To" <<Track[0] <<end1 ; } (f) Go through the C++ code shown below, and find out the possible output or outputs from the suggested Output Options (i) to (iv). Also, write the least value and highest value, which can be assigned to the variable Guess. 2 #include <iostream.h> #include <stdlib.h> void main ( ) { randomize ( ) ; int Guess, High=4; Guess=random{High)+ 50 ; for{int C=Guess ; C<=55 ; C++) cout<<C<<"#" ; } (i) 50 # 51 # 52 # 53 # 54 # 55 # (ii) 52 # 53 # 54 # 55 (iii) 53 # 54 # (iv) 51 # 52 # 53 # 54 # 55 2. (a) Differentiate between members, which are present within the private visibility mode with those which are present within the public visibility modes. 2 (b) Write the output of the following C++ code. Also. write the name of feature of Object Oriented Programming used in the following program jointly illustrated by the function [I] to [IV]. 2 #include<iostream.h> void Print ( ) // Function [I] { for (int K=1 ; K<=60 ; K++) cout<< "-" ; cout<<end1 ; } void Print (int N) // Function [II] { for (int K=1 ; K<=N ; L++) cout<<"*" ; cout<<end1 ; } void Print (int A, int.B) // Function [III] { for (int K=1. ;K<=B ;K++) cout <<A*K ; cout<<end1 ; } void Print (char T, int N) // Function [IV] 318 { for (int K=1 ; K<=N ; K++) cout<<T ; cout<<end1; } void main ( ) { int U=9, V=4, W=3; char C='@' ; Print (C,V) ; Print (U,W) ; } (c) Define a class Candidate in C++ with following description: 4 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 _ 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. (d) Answer the questions (i) to (iv) based on the following: 4 class Strident ( int Rno; char Name [20] ; float Marks; protected: void Result( ) ; public: Student( ) ; void Register( ); void Display( ) ; } ; class Faculty { long FCode; char FName[20]; protected: float Pay; public : Faculty ( ) ; void Enter ( ) ; void Show ( ) ; } ; class Course : public Student, private Faculty { long CCode [10]; char CourseName [50] ; char StartDate[8], EndDate[8] ; public : Course ( ) ; void Commence ( ) ; void CDetail ( ) ; } ; (i) Which type of inheritance is illustrated in the above C++ code? (ii) Write the names of the all data members, which is/are accessible from member function Commence of class Course. (iii) Write the names of member functions, which are accessible from objects of class Course. (iv) Write the name of all the members, which are accessible from objects of class Faculty. 3 (a) Write a Get1From2 ( ) function in C++ to transfer the content from two arrays 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[ ]. 3 Example: If the FIRST[ ] array contains 30, 60, 90 And the SECOND[ ] array contains 10, 50, 80 The ALL[ ] array should contain 30, 10, 60, 50, 90, 80 (b) An array P[20] [50] is stored in the memory along the column with each of its element occupying 4 bytes, find out the 1ocation of P[15][10], if P[0][0] is stored at 5200. 3 (c) Write a function in C++ to perform Insert: operation on a dynamically allocated Queue containing Passenger details as given in the following definition of NODE. 4 struct NODE { long Pno; //passenger Number char Pname[20] ; //passenger Name NODE *Link.; } ; (d) Write a COLSUM( ) function in C++ to find sum of each column of a NxM Matrix. 2 (e) Evaluate the following postfix notation of expression: 2 50, 60, + , 20, 10, -, * 4. (a) Observe the program segment given below carefully and fill the blanks marked as Statement 1 and Statement 2 using seekg( ), seekp( ), tellp( ) and tellg( ) functions for performing the required task. 1 #include<fstream.h> class PRODUCT { int Pno; char Pname[20); int Qty; public : void ModifyQty( ) ; // The function is to modify quantity of a PRODUCT } ; void PRODUCT: :ModifyQty ( ) { fstream File ; Fil.open ("PRODUCT.DAT", ios::binary |ios : : in| ios: ut) ; int MPno; cout<<"Product No to modify quantity : "; cin>>MPNo; While (Fil.read ((char*) this, sizeof (PRODUCT)) { if (MPno == Pno) { Cout<<"Present Quantity:"<<Qty<<end1 ; cout<<"Changed Quantity:";cin>>Qty ; int Position = _______________; //Statement 1 _________________________; // Statement 2 Fil.write ((char*) this, sizeof (PRODUCT)) ; //Re-writing the record } } Fil.close ( ) ; } (b) Write a function in C++ to count the no. of "Me" or "My" words present in a text file "DIARY. TXT". 2 If the file "DIARY.TXT" content is as follows: My first book was Me and My family. It gave me chance to be known to the world. The output of the function should be Count of Me/My in file : 4 (c) Write a function in C++ to search for a laptop from a binary file "LAPTOP.DAT" containing the objects of class LAPTOP (as defined below). The user should enter the Model No and the function should search and display the details of the laptop. 3 class LAPTOP { long ModelNo ; float RAM, HDD ; char Details [120] ; public: void StockEnter ( ) {cin>>ModelNo>>RAM>>HDD; gets (Details);} void StockDisplay ( ) {cout<<ModelNo<<RAM<<HDD<<Details<<endl;} long ReturnModelNo ( ) {return ModelNo ;} } ; 5 (a) What do you understand by Union & Cartesian Product operations in relational algebra? 2 Consider the following tables WORKER and PAYYLEVEL and answer (b) and (c) parts of this question: 4 Table: WORKER ECODE NAME DESIG PLEVEL DOJ DOB 11 Radhe Shyam Supervisor P001 13- Sep- 2004 23-Aug-1981 12 Chander Nath Operator P003 22-Feb-2010 12-Jul-1987 13 Fizza Operator P003 14-Jun-2009 14-0ct-1983 15 Ameen Ahmed Mechanic P002 21-Aug-2006 13-Mar-1984 18 Sanya Clerk P002 19-Dec-2005 09-Jun-1983 Table: PAYLEVEL PLEVEL PAY ALLOWANCE P001 26000 12000 P002 22000 10000 P003 12000 6000 (b) 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 DE;SIG 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) To add a new row with the following: 19, 'Daya Kishore', 'Operator', 'P003', '19-Jun-2008', '11-Jun-1984' (c) Give the output of the following SQL queries: 2 (i) SELECT COUNT (PLEVEL), PLEVEL FROM WORKER GROUP BY PLEVEL; (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' ; 6 (a) Verify the following using Truth Table. 2 U. (U' +V) = (U + V) (b) Write the equivalent Boolean Expression for the following logic Circuit. 2 (c) Write the POS form of a Boolean function F, which is represented in a truth table as follows: 1 A B C F 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1 (d) Reduce the following Boolean Expression using K-Map: 3 F(P, Q, R, S) = (0,1,2,4,5,6,8, 12) 7. (a) Differentiate between packet switching and message switching technique in network communication. 1 (b) Differentiate between BUS and STAR topology of networks. 1 (c) What is VoIP? 1 (d) Out of the following, identify client side script (s) and server side script(s). 1 (a) ASP (b) Javascript (c) VBScript (d) JSP (e) Quick learn University is setting up its Academic blocks at Prayag Nagar and planning to set up a network. The university has 3 academic blocks and one Human Resource Center as shown in the diagram below. 4 Center to center distance between various block/center is as follows: Law Block to Business Block 40m Law Block to Technology Block 80m Law Block to HR Center 105m Business Block to Technology Block 30m Business Block to HR Center 35m Technology Block to HR Center 15m Number of Computers in each of the Blocks/Centre is follows: Law Block 15 Technology Block 40 HR Center 115 Business Block 25 (e1 ) Suggest the most suitable place (i.e. Block/Center) to install the server of this university with a suitable reason. (e2) Suggest an ideal layout for connecting these blocks/centers for a wired connectivity. (e3) Which device you will suggest to be placed/installed in each of these blocks/ center to efficiently connect all the computers with in these blocks/center. (e4) The university is planning to connect its admission office in the closest big city, which is more than 250 km from university, which type of network out of LAN, MAN or WAN will be formed? Justify your answer. (f) Which of the following will come under Cyber Crime? 1 (i) Theft of a brand new sealed pack Laptop (ii) Access to a bank account for getting unauthorized Money Transaction (iii) Modification in a company data with unauthorized access (iv) Photocopying a printed report (g) Compare open source software and proprietary software. 1 COMPUTER SCIENCE QUESTION PAPER CODE 91 1. (a) What is the difference between Type Casting and Automatic Type conversion? Also, give a suitable C++ code to illustrate both. 2 (b) Write the names of the header files, which is/are essentially required to run/ execute the following c++ code: 1 void main ( ) { char CH,Text[ ] ="+ve Attitude"; for (int I=0 ; Text[I] ! ='\0' ;I++) if (Text[I]== ' ') cout<<end1; else { CH=toupper (Text [I]) ; cout<<CH; } } (c) Rewrite the following program after removing the syntactical errors (if any). Underline each correction. 2 include<iostream.h> typedef char [80] String; void main ( ) { String S= "Peace"; int L=strlen(S) ; cout<<S<< 'has'<<L<< 'characters'<<end1; } (d) Find the output of the following program: 3 #include <iostream.h> void SwitchOver(int A [ ], int N, int Split) { for (int K=0 ; K<N; K++) if (K<Split) A(K]+ =K; else A [K]*=K; } void Display (int A [ ], int N) { for (int K=0 ; K<N ; K++) (K%2==0)? cout<<A[K]<<"%":cout<<A(K]<<end1; } void main ( ) { int H[ ]= {30,40,50,20,10,5}; SwitchOver (H, 6, 3); Display (H, 6); } (e) Find the output of the following program: 2 #include<iostream.h> void main ( ) { int *Queen, Moves [ ] = {11, 22, 33, 44}; Queen = Moves; Moves [2] + = 22; Cout<< "Queen @"<<*Queen<<end1; *Queen - = 11; Queen + = 2; cout<< "Now @"<<*Queen<<end1; Queen++; cout<< "Finally@"<<*Queen«end1; cout<< "New Origin @"<<Moves[0]<<end1; } (f) Go through the C++ code shown below, and find out the possible output or outputs from the suggested Output Options (i) to (iv). Also, write the minimum and maximum values, which can be assigned to the variable MyNum. 2 #include<iostream.h> #include <stdlib.h> void main ( ) { randomize ( ) ; int MyNum, Max=5; MyNum = 20 + random (Max) ; for (int N=MyNum; N<=25;N++) cout<N<"*"; } (i) 20*21*22*23*24*25 (ii) 22*23*24*25* (iii) 23*24* (iv) 21*22*23*24*25 2. (a) Differentiate between Constructor and Destructor function with respect to Object Oriented Programming. 2 (b) Write the output of the following C++ code. Also, write the .name of feature of Object Oriented Programming used in the following program jointly illustrated by the function [I] to [IV] 2 #include<iostream.h> void Line ( ) //Function [I] { for (int L=1;L<=80;L++) cout<<"-"; cout<<end1; } void Line (int N) //Function[II] { for (int L=l;L<=N;L++) Cout<<"*"; cout<<endl; } void Line (char C, int N) //Function [III] { for (int L=l;L<=N;L++) cout<<C; cout<<end1; } void Line (int M, int, N) //Function [IV] { for (int L=1;L<=N;L++) cout<<M*L; cout<<end1; } void main ( ) { int A=9, B=4, C=3; char K= '#' ; Line (K,B); Line (A,C); } (c) Define a class Applicant in C++ with following description: 4 Private Members _ A data member ANo (Admission Number) of type long _ A data member Name of type string _ A data member Agg (Aggregate Marks) of type float _ A data member Grade of type char _ A member function GradeMe() to find the Grade as per the Aggregate Marks obtained by a student. Equivalent Aggregate Marks range and the respective Grades are shown as follows: Aggregate Marks Grade >=80 A less than 80 and >=65 B less than 65 and >=50 C less than 50 D Public Members _ A function ENTER() to allow user to enter values for ANo, Name, Agg & call function GradeMe() to find the Grade. _ A function_RESULT( ) to allow user to view the content of all the data members. (d) Answer the questions (i) to (iv) based on the following: 4 class Student { int Rollno: char SName[20]; float Marksl; protected: void Result ( ) ; public: Student ( ) ; void Enroll ( ) ;void Display ( ) ; } ; class Teacher { long TCode; char TName [20]; protected: float Salary; public: Teacher ( ); void Enter ( ) ; void Show ( ) ; } ; class Course: public Student, private Teacher } long CCode [10]; char CourseName [50]; char StartDate [8] , EndDate [8]; public: Course ( ) ; void Commence ( ); void CDetail ( ) ; } ; (i) Write the names of member functions, which are accessible from objects of class Course (ii) Write the names of all the data members, which is/are accessible from member function Commence of class Course (iii) Write the names of all the-members, which are accessible from objects of class Teacher. (iv) Which type of Inheritance is illustrated in the above C++ code? 3. (a) Write a Get2From1() function in C++ to transfer the content from one array ALL[] to two different arrays Odd[] and Even[]. The Odd[] array should contain the values from odd positions (1,3,5,...) of ALL[] and Even [] array should contain the values from even positions (0, 2, 4,…..) of ALL []. 3 Example If the ALL[] array contains 12, 34, 56, 67, 89, 90 The Odd[] array should contain 34, 67, 90 And the Even [] array should contain 12, 56, 89 (b) An array G[50][20] is stored in the memory along the row with each of its elements occupying 8 bytes. Find out the location of G[10][15], if G[0][0] is stored at 4200. 3 (c) Write a function in C++ to perform Delete operation on a dynamically allocated Queue containing Members details as given in the following definition of NODE: 4 struct NODE { long Mno //Member Number char Mname[20]; //Member Name NODE *Link; }; (d) Write a DSUMO function in C++ to find sum of Diagonal Elements from a NxN Matrix. 2 (Assuming that the N is a odd number) (e) Evaluate the following postfix notation of expression: 2 True, False, NOT, AND, True, True, AND,OR 4. (a) Observe the program segment given below carefully and fill the blanks marked as Statement 1 and Statement 2 using seekg( ), seekp( ) tellp( ) and tellg( ) functions for performing the required task. 1 #include <fstream.h> class ITEM { int Ino;char Iname[20]; float Price; public: void ModifyPrice() ;//The function is to modify price of a particular ITEM } ; void item: :ModiyPrice() { fstream File; File.open ("ITEM.DAT", ios::binary | ios::in | ios: ut) || ; int CIno; cout<<"Item No to modify price:";cin>>CIno; while (file.read ((char*) this, sizeof (ITEM))) { if (CIno==Ino) { cout<<"Present Price:"<<Price<<end1; cout<<"Changed price:"; cin>>Price; int FilePos = __________ ; //Statement 1, ___________________; //Statement 2 File.write((char*)this,sizeof(ITEM)) ; // Re-writing the record } } File.close ( ) ; } (b) Write a function in C++ to count the no. of "He" or "She" words present in a text file "STORY. TXT". 2 If the file "STORY. TXT" content is as follows: He is playing in the ground. She is Playing with her dolls. The output of the function should be Count of He/She in file: 2 (c) Write a function in C++ to search for a camera from a binary file "CAMERA.DAT" containing the objects of class" CAMERA (as defined below). The user should enter the Model No and the function should search display the details of the camera. 3 class CAMERA { long ModelNo; float MegaPixel; int Zoom; char Details[120]; public: void Enter ( ) {cin>>ModelNo>>MegaPixel>>Zoom;gets(Details);} void Display ( ) {cout<<ModelNo<<MegaPixel<<Zoom<<Details<<endl;} long GetModelNo ( ) {return ModelNo;} }; 5. (a) What do you understand by Selection & Projection operations in relational algebra? 2 Consider the following tables EMPLOYEE and SALGRADE and answer (b) and (c) parts of this question: Table: EMPLOYEE ECODE NAME DESIG SGRADE DOJ DOB 101 Abdul Ahmad EXECUTIVE S03 23-Mar-2003 13-Jan-1980 102 Rav:i. Chander HEAD-IT S02 12-Feb-2010 22-Jul-1987 103 John Ken RECEPTIONIST S03 24-June-2009 24-Feb-1983 105 Nazar Ameen GM S02 11-Aug-2006 03-Mar-1984 108 Priyam Sen CEO S01 29-Dec-2004 19-Jan-1982 Table: SALGRADE SGRADE SALARY HRA S0l 56000 18000 S02 32000 12000 S03 24000 8000 (b) Write SQL commands for the following statements: 4 (i) To display the details of all EMPLOYEEs, in descending order of DOJ (ii) To display NAME and DE51G of those EMPLOYEEs, whose SALGRADE is either 502 or 503 (iii) To display the content of all the EMPLOYEEs table, whose DOJ is in between'09-Feb-2006' and '08-Aug-2009'. (iv) To add a new row with the following: 109, 'Harish Roy', 'HEAD-IT', 'S02', '09-Sep-2007, '21-Apr-1983' (c) Give :the output of the following SQL queries: 2 (i) SELECT COUNT (SGRADE), SGRADE FROM EMPLOYEE GROUP BY SGRADE; (ii) SELECT MIN(DOB), MAX (DOJ) FROM EMPLOYEE; (iii) SELECT NAME , SALARY FROM EMPLOYEE E, SALGRADE S WHERE E.SGRADE= S.SGRADE AND E.ECODE<103; (iv) SELECT SGRADE, SALARY+HRA ETM SALGRADE WHERE SGRADE='S02'; 6 (a) Yerify the following using Truth Table: 2 X+Y. Z=(X+Y).(X+Z) (b) Write the equivalent Boolean Expression for the following Logic Circuit: 2 (c) Write the SOP form of a Boolean function F, which is represented in a truth table as follows: 1 U V W F 0 0 0 1 0 0 1 0 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 1 (d) Reduce the following Boolean Expression using K-Map: 3 F(A, B,C, D) = (0,1, 2, 4, 5, 6, 7, 8, 10) 7. (a) In networking, what-is WAN? How is it different from LAN? 1 (b) Differentiate between XML and HTML. 1 (c) What is WEB2.0? 1 (d) Out of the following, identify client side script (s) and server side script (s). 1 (i) Javascript (ii) ASP (iii) vbscript (iv) JSP (e) Great Studies University is setting up its Academic schools at Sunder Nagar and planning to set up a network. The university has 3 academic schools and one administration center as shown in the diagram below: 4 Center to center distances between various buildings is as follows : Law School to Business School 60m Law School to Technology School 90m Law School to Admin Center 115m Business School to Technology School 40m Business School to. Admin Center 45m Technology School to Admin Center 25m Number of Computers in each of the Schools/Center is follows: Law School 25 Technology School 50 Admin Center 125 Business School 35 (i) Suggest the most suitable place (i.e. School/Center) to install the server of this university with a suitable reason. (ii) Suggest an ideal layout for connecting these schools/ center for a wired connectivity. (iii) Which device will you suggest to be placed/installed in each of these schools / center to efficiently connect all the computers within these schools / center? (iv) The university is planning to connect its admission office in the closest big city, which is more than 350 km from the university. Which type of network out of LAN, MAN or WAN will be formed? Justify your answer. (f) Compare Open Source Software and Proprietary Software. 1 (g) What are cookies? 1 Last edited by Neelurk; March 14th, 2020 at 10:29 AM. |
|