CBSE Sample Papers For Class 12 Computer Science Set 6 With Solutions
CBSE Sample Papers For Class 12 Computer Science Set 6 With Solutions
(i) To show all information about the Sofa from the INTERIORS table.
(ii) To list the ITEMNAME, which are priced at more than 10000 from the INTERIORS table.
(iii) To list ITEMNAME and TYPE of those items, in which DATEOFSTOCK is before 22/01/02 from the
INTERIORS table in descending order of ITEMNAME.
Question 29.
Write a user defined function to accept a string and check whether it is palindrome or not.
(A palindrome is a string that is same as its reverse) [3]
Question 30.
Explain the traversal operation in a stack. [3]
Write the algorithm for Traversal of a stack to display its contents.
You need not to write the actual code.
Section – D
Question 31.
Consider the following table [1 × 4 = 4]
TABLE:INTERIORS
Write statements to
(a) Write a command to display only the Column ITEMNAME , Net Amount(PRICE- DISCOUNT)
(b) Display only ITEMNAME and Discount column.
(c) Which clause is to be used to search non blank values in the table?
(d) Which command will be used to make the “No” column as the primary key?
Question 32.
A binary file “Telephone.dat” exists storing details of BSNL customers as per following structure. [4]
PhoneNo CustomerName ConnType
Write a program in Python for adding and displaying record count from the binary file using following
functions
NewCustomer() To add data of customers to the binary file “Telephone.dat”.
Note : The existing connection data should be preserved.
PrintConnections() To open the file “Telephone.dat” and display the connections and number of
connections.
Section – E
Question 33.
Tech Up Corporation (TUC) is a professional consultancy company. The company is planning to set up their
new offices in India with its hub at Hyderabad. As a network adviser, you have to understand their
requirement and suggest to them the best available solutions. Their queries are mentioned as (a) to (e)
below. [1 × 5 = 5]
(a) What will the most appropriate block, where TUC should plan to install their server?
(b) Draw a block to block cable layout to connect all the buildings in the most appropriate manner for
efficient communication.
(c) Write names of different types of Modems.
(d) Which of the following devices will be suggested by you to connect each computer in each of the
buildings?
(i) Gateway
(ii) Switch
(iii) Modem
(e) Company is planning to connect its Block in Hyderabad which is more than 20 km. Which type of
network will be formed?
Question 34.
(a) What is DDL? Explain with its commands. [1 + 4 = 5]
(b) Write a code in Python to update the class of a student to 12 whose roll number is 22. The table
structure is as follows :
RollNo Name Class Perc
Note:
Database :PythonDB
Table: Student
Host: localhost
UserId:root
Password: arihant
Or
(a) What is DML? Explain with its commands.
(b) Write a code in Python to delete the record of a student whose rollno is 33.
The table structure is as follows
RollNo Name Class Perc
Note :
Database :PythonDB
Table: Student
Host: localhost
UserId:root
Password: arihant
Question 35.
(a) What is the use of writerows() function for CSV files? [2 + 3=5]
(b) A binary file “Hotel.dat” exists storing details of hotel customers as per following structure:
RoomId CustomerName Days
Write a program in Python for adding and displaying records from the binary file using following functions
Reserve() To add data of customers to the binary file.
ShowReservations() To open the file “Hotel.dat” and display all the records.
Or
(a) What is csv. reader() function?
(b) Write a program in Python to modify records of a binary file “hotel.dat” using random access. The
program would accept the room id, search the record by random access and display. It will then accept the
new data and modify the file.
The file structure is
RoomId Customer Name Days