Name of the Board : CBSE Academic
Class : XII STD
Document Type : Sample Question Paper
Subject : Computer Science
Year : 2017-18
Website : http://cbseacademic.nic.in/SQP_CLASSXII_2017_18_final.html
Download Sample Question Paper : https://www.pdfquestion.in/uploads/22326-ComputerScience-SQP.pdf
Marking Scheme : https://www.pdfquestion.in/uploads/22326-ComputerScience-MS.pdf
Computer Science Question Paper :
Instructions :
(a) All questions are compulsory,
(b) Answer either Section A or Section B
Related : CBSE Academic XII STD Computer Science Sample Question Paper 2016 – 17 : www.pdfquestion.in/10039.html
(i) Section A – Programming Language with C++
(ii) Section B – Programming Language with Python
(c) Section C is compulsory.
Section – A : (C++)
Q1. (a) What is the role of a parameter/argument passed in a function? Can a default value be assigned to a parameter(Yes/No)? If yes, justify your answer with the help of a suitable example otherwise give reason.
2 (b) Raman suggests Kishan the following header files which are required to be included in the given C++ program. Identify the header files which are wrongly suggested by Raman.
Suggested header files :
1. iostream.h
2. stdio.h
3. conio.h
4. ctype.h
(c) Rewrite the following program after removing the syntactical errors (is any). Underline each correction.
(d) Write the output of the following C++ program code(assume all necessary header files are included in program)
(e) Write the output of the following C++ program code(assume all necessary header files are included in program)
(f) Consider the following C++ program code and choose the option(s) which are not possible as output. Also, print the minimum & maximum value of variable Pick during complete execution of the program.(assume all necessary header files are included in program)
(a) 5:6:6:6:
(b) 4:7:5:3:
(c) 8:6:1:2:
(d) 7:5:3:1
Q2. (a) What do you mean by Data Abstraction in OOPs? Explain its significance in programming with a suitable example.
(b) Answer the question (i) & (ii) after going through the following code. (assume all necessary header files are included in program)
(i) Give the name of the feature of OOP which is implemented by Function 1 & 2 together in the above class Game.
(ii) Anuj made changes to the above class Game and made Function 3 private. Will he be able to execute the Line 1 successfully given below? Justify.
void main()
{
Game ABC; //Line 1
}
(c) Define a class Bill in OOP with the following specification
Private members :
1. Bill_no – type long(bill number)
2. Bill_period – type integer(number of months)
3. No_of_calls – type integer(number of mobile calls)
4. Payment_mode – type string(“online” or “offline”)
5. Amount – type float(amount of bill)
6. Calculate_Bill() function to calculate the amount of bill given as per the following conditions :
No_of_calls Calculation Rate/call (in rupees)
<=500 1.0
501-1200 2.0
>1200 4.0
Also, the value of Amount should be reduced by 5% if Payment_mode is “online”.
Public members :
1. A member function New_Bill() that will accept the values for Bill_no, Bill_period, No_of_calls, Payment_mode from the user and invoke Caluclate_Bill() to assign the value of Amount.
2. A member function Print_Bill() that will display all details of a Bill.
(d) Answer the question from (i) to (iv) based on the given below code(assume all necessary header files are included in program)
(i) Write name of the class whose constructor is invoked first on the creation of a new object of class Country.
(ii) Write name of the data members which are accessible through the object of class Country.
(iii) List name of the members which are accessible through the member function “void New_Country()”.
(iv) What will be the size(in bytes) of an object of class Country & State respectively.
Q3 (a) Write the definition of function named Array_Swap() that will accept an integer array & its size as arguments and the function will interchange/swap elements in such a way that the first element is swapped with the last element, second element is swapped with the second last element and son on, only if anyone or both the elements are odd.
E.g. if initially array of seven elements is : 5, 16, 4, 7, 19, 8, 2
After execution of the above function, the contents of the array will be : 2,16, 19, 7, 4, 8, 5
(b) An array A[50][30] is stored along the row in the memory with each element requiring 4 bytes of storage. If the element A[10][15] is stored at 21500, then find out the base address of the array and the memory address of element stored at location A[30][25]?
(c) Write the definition of a member function Q_Insert() for a class Exam_Queue in C++ to insert a new Application information in a dynamically allocated queue whose code is already given below as a part of the program(assume all necessary header files are included in program)
(d) Write the definition of a user-defined function REPEAT_ROW(int A[][3],int R, int C) in C++ that will store the elements in the following manner
1. All row elements except the 1st element replaced by the 1st element,
2. All row elements except the 1st & 2nd element replaced by the 2nd element,
3. All row elements except the 1st , 2nd & 3rd element replaced by the 3rd element and
(e) Evaluate the following POSTFIX expression. Show the status of Stack after execution of each operation separately
TRUE, FALSE, OR, NOT, TRUE, FALSE, AND, OR
Q4. (a) Answer the questions (i) & (ii) in the program segment given below for the required task.
(i) Write Statement 1 to position the file pointer to the appropriate place so that the data updation is done for the correct Route.
(ii) Write Statement 2 to perform the write operation so that the updation is done in the binary file “ROUTE.DAT”.
(b) Write a user-defined function named Count() that will read the contents of text file named “Report.txt” and count the number of lines which starts with either „I‟ or „M‟. E.g. In the following paragraph, there are 2 lines starting with „I‟ or „M‟
“India is the fastest growing economy.
India is looking for more investments around the globe.
The whole world is looking at India as a great market.
Most of the Indians can foresee the heights that India is capable of reaching.”