CBSE Previous Year Solved Papers Class 12 Computer Science Delhi 2013
Time allowed : 3 hours Maximum Marks: 70
General Instructions :
- There are a total of 26 questions and five sections in the question paper, All questions are compulsory.
- Section A contains question number 1 to 5, Very Short Answer type questions of one mark each.
- Section B contains question number 6 to 10, Short Answer type I questions of two marks each.
- Section C contains question number 11 to 22, Short Answer type II questions of three marks each.
- Section D contains question number 23, Value Based Question of four marks.
- Section E contains question number 24 to 26, Long Answer type questions of five marks each.
- There is no overall choice in the question paper, however, an internal choice is provided in one question of two marks, one question of three marks and all three questions of five marks. An examined is to attempt any one of the questions out of two given in the question paper with the same question number.
Question.1. (a) What is the benefit of using (unction prototype for a function? Give a suitable example to illustrate it using C++ code.
Answer: The benefit of using function prototype for a function is that, it tells the compiler that there is a some function defined somewhere in the program and we can access it.
(b) Observe the following C++ code and write the name(s) of the header file(s), which will be essentially required to run it in a C++ compiler:
(c) Observe the following C++ code carefully and rewrite the same after removing all the syntax error(s) present in the code. Ensure that you underline each correction in the code.
• All the desired header files are already included, which are required to run the code.
• Correction should not change the logic of the program.
(d) Observe the following C++ code carefully and obtain the output, which will appear on the screen after execution of it.
• All the desired header files are already included in the code, which are required to run the code.
(e) Observe the following C++ code carefully and obtain the output, which will appear on the screen alter execution of it.
(f) Based on the following C++ code find out the expected correct output(s) from the option (i) to (iv). Also, find out the minimum and the maximum value that can be assigned to the variable Guess used in the code , at the time when value of Count is 3.
Question.2 (a) Write any two difference between Constructor and Destructor. Write the function headers for constructor and destructor of a class Member.
(b) Answer the questions (i) and (ii) after going through the following class:
(iii) Out of the following, which of the option is correct for calling Function 2 ?
Option 1-Motor N(M);
Option 2-Motor P(10);
(iv) Name the feature of Object Oriented Programming, which is illustrated by Function 1, Function 2 and Function 3 combined together.
(i) Option-2 Motor P( 10);
(ii) Constructor overloading.
(c) Define a class Tourist in C++ with the following specifications: Data Members
• Carno – to store Bus No
• Origin — to store Place name of origin
• Destination – to store Place name of destination
• Type – to store Bus Type such as ‘E’ for Economy
• Distance – to store the Distance in Kilometres
• Charge -to store the Car Fare Member Functions
• A constructor function to initialize Type as ‘E’ and Freight as 250
• A function Calc Charge( ) to calculate Fare as per the following criteria:
• A function Enter( ) to allow user to enter values for Carno, Origin, Destination, Type and Distance. Also, this function should call CalcCharge( ) to calculate Fare.
• A function Show() to display the content of all the data members on screen.
(d) Consider the following C++ code and answer the questions from (i) to (iv):
(i) Which type of inheritance is shown in the above example?
(ii) Write the names of those data members, which can be directly accessed from the objects of class Report.
(iii) Write the names of those member functions which can be directly accessed from the objects of class Report.
(iv) Write names of those data members, which can be directly accessed from the SentryO function of class Score.
(i) Multilevel Inheritance
(ii) OverallGrade, Remarks
(iii) REvaluate(), RPrint(), Sentry(), S display( );
(iv) SName, Marks, Grade
Question.3. (a) Write code for a function void Convert (int T[ ],int , Num) in C++, which re-positions all the elements of the array by shifting each of them to one position before and by shifting the first element to the last position.
For example if the content of array is
(b) An array P  is stored along the column in the memory with each element requiring 4 bytes of storage. If the base address of array P is 14000, find out the location of P .
(c) Write a user defined function DispNTen(int L[ ] , int R, int C) in C++ to find and display all the numbers, which are not divisible by 10. For example if the content of array is:
The output should be 17 12 19
(d) Evaluate the following post fix expression. Show the status of stack after execution of each operation:
60,6, /, 5, 2, *, 5, -, +
(e) Write a function QINSERT( ) in C++ to perform insert operation on a Linked Queue, which contains Client no and Client name. Consider the following definition of NODE in the code of OINSERT().
Question.4. (a) Fill in the blanks marked as Statement 1 and Statement 2, in the program segment given below with appropriate functions for the required task.
(b) Write a function Count His Her() in C++ which reads the contents of a text file diary.txt and counts the words. His and Her (not case sensitive).
For example, if the file contains:
Pinky has gone to his friend’s house. His friends name is Ravya. Her house is 12 KM from here.
The Function should display the OUTPUT as:
Count for His : 2
Count for Her : 1
(c) Assuming the class VINTAGE as declared below, write a function in C++ to read the objects of VINTAGE from binary file VINTAGE.DAT and display those vintage vehicles, which are priced between 200000 and 250000.
Question.5. (a) What is the difference between degree and cardinality of a table? What is the degree and cardinality of the following table?
Answer: The total number of columns present in the table is called DEGREE OF A TABLE, whereas, total number of rows present in the table is called CARDINALITY OF A TABLE. IN THE GIVEN TABLE:
Write SQL queries for (b) to (g) and write the outputs for the SQL queries mentioned shown in (h1) to (h4) parts on the basis of tables ITEMS and TRADERS.
(b) To display the details of all the items in ascending order of product names (i.e. I NAME).
Answer : select from ITEMS order by I NAME;
(c) To display item name and price of all those items, whose price is in the range of 10000 and 22000 (both value inclusive).
Answer : Select I NAME,PRICE from ITEMS where PRICE>= 10000 and PRICE<=22000;
(d) To display the number of products, which are supplied supplier, i.e., the expected output should be:
T01 2 T02 2 T03 1
Answer: select TCODE, count(TCODE) from ITEMS group by TCODE;
(e) To display the price, item name and quantity (i.e., qty) of those products which have quantity more than 150.
Answer: select PRICE, INAME, QTY from ITEMS
where QTY> 150;
(f) To display the names of those traders, who are either from DELHI or from MUMBAI.
Answer: select TNAME from TRADERS where
CITY=”DELHI” or CITY=”MUMBAI”;
(g) To display the name of the companies and the name of the items in descending order of company names.
Answer: select COMPANY, INAME from ITEMS order by COMPANY desc;
(h) Obtain the outputs of the fallowing SQL, queries based on the data given in tables ITEMS and TRADERS above.
(1) SELECT MAX(PRICE), MIN(PRICE) FROM ITEMS;
(2) SELECT PRICE*QTY AMOUNT FROM ITEMS WHERE PID=1004;
(3) SELECT DISTINCT TCODE FROM ITEMS;
(4) SELECT INAME, TNAME FROM ITEMS I, TRADERS T WHERE I.TCODE=T.TCODE AND QTY<100;
Question.6. (a) Verify the following using Boolean Laws
A + C = A + A’ .C + B.C
Here all values of column A+A’.C+B.C and column A+C are same Hence proved.
(b) Obtain the Boolean Expression for the logic circuit shown below:
Answer: The Boolean expression for the given logic circuit is:
F = X’Y+(Y+Z’)
(c) Write the Sum of Product form of the function F(U, V, W) , for the following truth table representation of F.
(d) Obtain the minimal form for the following Boolean expression using map.
Question.7. (a) What is the difference between domain name and IP address?
• IP address is an identifier for a computer or device on a TCP/IP network.
For example, 192.168.1.1 could be an IP address.
• A domain name is a name that identifies one or more IP addresses.
For example, the domain name Microsoft.com represents about a dozen IP addresses.
(b) Write two advantages of using an optical fibre cable over an Ethernet cable to connect two service stations, which are 190m away from each other.
Two using an optical fibre cable over an Ethernet cable are:
• Provides high speed.
• Electrical and magnetic interference does not affect the transmission.
(c) Expertia Professional Global (EPG) is an online corporate 4 training provider company for IT related courses. The company is setting up their new campus in Mumbai. You as a network expert have to study the physical locations of various blocks and the number of computers to be installed. In the planning phase, provider the best possible answer for the queries (i) to (iv) raised by them.
(i) Suggest the most appropriate block, where EPG should plan to install the server.
(ii) Suggest the most appropriate block to block cable layout to connect all three blocks for efficient communication.
(iii) Which type of network out of the following is formed by connecting the computers of these three blocks?
(iv) Which wireless channel out of the following should be opted by EPG to connect to students from all over the world?
• Microwave Satellite
(i) Faculty studio block is most appropriate block to install the server.
(d) Write two advantages of using proprietary software over open source software.
Answer : Two advantages of using open source software over proprietary software are:
• For the same reason, they can be less “user-friendly” and easy to use because less attention is paid to developing the user interface:
• There may also be less support available for when things go wrong – open source software tends to rely on its community of users to respond to and fix problems.
(e) Which of the following crime(s) is/are covered under cybercrime?
(i) Stealing brand new hard disk from a shop.
(ii) Copying some important data from a computer without taking permission from the owner of the data.
(iii) Getting into unknown person’s social networking account and start messaging on his behalf.
(i) Copying some important data from a computer without taking permission from the owner of the data.
(ii) Getting into unknown persons social networking account and start messaging on his behalf.