{"id":156593,"date":"2024-01-04T09:30:52","date_gmt":"2024-01-04T04:00:52","guid":{"rendered":"https:\/\/www.learncbse.in\/?p=156593"},"modified":"2024-01-04T11:40:13","modified_gmt":"2024-01-04T06:10:13","slug":"cbse-sample-papers-for-class-12-computer-science-set-6","status":"publish","type":"post","link":"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/","title":{"rendered":"CBSE Sample Papers for Class 12 Computer Science Set 6 with Solutions"},"content":{"rendered":"

Students must start practicing the questions from\u00a0CBSE Sample Papers for Class 12 Computer Science with Solutions<\/a> Set 6 are designed as per the revised syllabus.<\/p>\n

CBSE Sample Papers for Class 12 Computer Science Set 6 with Solutions<\/h2>\n

Time: 3 hrs Max.
\nMarks: 70<\/p>\n

Instructions<\/span><\/p>\n

1. Please check this question paper contains 35 questions.
\n2. The paper is divided into 5 Sections A, B, C, D and E.
\n3. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
\n4. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
\n5. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
\n6. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
\n7. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
\n8. All programming questions are to be answered using Python Language only.<\/p>\n

Section – A<\/span><\/p>\n

Question 1.
\nState True or False [1]
\n\u201cThe method that can be used to delete a range of values from a list is del\u201d.
\nAnswer:
\nTrue<\/p>\n

Question 2.
\nIn which module, ceil() function resides? [1]
\n(a) pandas
\n(b) pyplot
\n(c) random
\n(d) math
\nAnswer:
\n(d) math<\/p>\n

Question 3.
\nGiven L=[2,3,4,5,6]. The output of print(L[-1:-5]) is [1]
\n(a) [6,5,4]
\n(b) Error
\n(c) []
\n(d) [6,5]
\nAnswer:
\n(c) []<\/p>\n

\"CBSE<\/p>\n

Question 4.
\nThe ……. function returns True if all the characters in a string are digits. [1]
\n(a) isalnum()
\n(b) isdigit()
\n(c) isnumber()
\n(d) isalpha()
\nAnswer:
\n(b) isdigit()<\/p>\n

Question 5.
\nGiven a tuple t=(2,5,1,6,3). The statement t.sort() returns [1]
\n(a) (1,2,3,5,6)
\n(b) (6,5,3,2,1)
\n(c) Error
\n(d) None of these
\nAnswer:
\n(c) Error<\/p>\n

Question 6.
\nThe seek(n) places the file pointer at position n with reference to [1]
\n(a) Beginning
\n(b) End
\n(c) Current position
\n(d) Position 10
\nAnswer:
\n(a) Beginning<\/p>\n

Question 7.
\nTo see a list of all the databases in the system , the command may be used. [1]
\n(a) Show
\n(b) Show databases
\n(c) Display databases
\n(d) View databases
\nAnswer:
\n(b) Show databases<\/p>\n

Question 8.
\nIt is a way to convey a Python object into a character stream. [1]
\n(a) Pickling
\n(b) Unpickling
\n(c) dump() method
\n(d) load() method
\nAnswer:
\n(a) Pickling<\/p>\n

Question 9.
\nin and not in are ……. Operators. [1]
\n(a) Arithmetic
\n(b) Membership
\n(c) Logical
\n(d) Identity
\nAnswer:
\n(b) Membership<\/p>\n

Question 10.
\nRows of a relation are called [1]
\n(a) relation
\n(b) tuples
\n(c) data structure
\n(d) an entity
\nAnswer:
\n(b) tuples<\/p>\n

Question 11.
\nFill in the blank: While opening a binary file the character has to be added to the mode of opening. [1]
\n(a) b
\n(b) x
\n(c) u
\n(d) b
\nAnswer:
\n(a) b<\/p>\n

Question 12.
\nIf a table cames 10 columns and 15 rows, what is its degree? [1]
\n(a) 10
\n(b) 150
\n(c) 15
\n(d) 25
\nAnswer:
\n(a) 10<\/p>\n

Question 13.
\nState whether the following statement is True or False : Modulation and demodulation is performed by modem. [1]
\nAnswer:
\nTrue<\/p>\n

\"CBSE<\/p>\n

Question 14.
\nt1=(9, 6, 7, 6)
\nt2=(2, 8, 12, 20)
\nThe output of the statement below is [11
\nprint( min(t1) + max(t2))
\n(a) 26
\n(b) 25
\n(c) Error
\n(d) None of these
\nAnswer:
\n(a) 26<\/p>\n

Question 15.
\nFill in the blank is a system of interlinked hypertext accessed via internet. [1]
\nAnswer:
\nWWW<\/p>\n

Question 16.
\nThe arrangement where all data pass through a central computer is known as
\n(a) ring topology
\n(b) mesh topology
\n(c) star topology
\n(d) bus topology
\nAnswer:
\n(c) Star topology<\/p>\n

Directions In the question numbers 17 and 18, a statement of Assertion (A) is followed by a statement of
\n(R). Choose the correct option.<\/p>\n

Question 17.
\nAssertion (A)Pickling is a way to convey a Python object into character stream.
\nReason (R) To perform pickling, the pickle module needs to be imported.
\n(a) Both A and R are true and R is the correct explanation for A.
\n(b) Both A and R are true but R is not the correct explanation for A.
\n(c) A is true but R is false.
\n(d) A is false but R is true.
\nAnswer:
\n(a) Both A and R are true and R is the correct explanation for A.<\/p>\n

Question 18.
\nAssertion (A) A recursive function does not require a loop. [1]
\nReason (R) A recursive function calls itself again and again until a certain condition is true.
\n(a) Both A and R are true and R is the correct explanation for A.
\n(b) Both A and R are true but R is not the correct explanation for A.
\n(c) A is true but R is false.
\n(d) A is false but R is true.
\nAnswer:
\n(a) Both A and R are true and R is the correct explanation for A.<\/p>\n

Section – B<\/span><\/p>\n

Question 19.
\n(a) Expand the following terms [1+1=2]
\nPPP, XML
\n(b) What is the mean by SMS?
\nAnswer:
\n(a) PPP Point-to-Point
\nXML extensible Markup Language
\n(b) SMS (Short Message Service) commonly referred to as text messaging, is a service for sending short messages upto 160 characters to mobile devices.<\/p>\n

Or<\/p>\n

(a) Mr. Lai owns a factory which manufactures automobile spare parts. Suggest him the advantages of having a web page for his factory.
\n(b) Name one commonly used open source Internet browser and one commonly used open source operating system.
\nAnswer:
\n(a) The web page provides the information to the clients about his factoy of spare parts. Moreover, he can receive the order on the Internet from the client using the web page.
\n(b) Open source internet browser – Chromium
\nOpen source operating system – Linux<\/p>\n

Question 20.
\nObserve the code given below and find the output [2]<\/p>\n

s=\u201doceanview\u201d\r\ncount=0\r\nfor a in s:\r\nif a in \u201cstuv\u201d:\r\ncount+= 1\r\nprint(count)<\/pre>\n

Answer:
\n1
\nThe for loop checks for existence of the characters of the string in \u201cstuv\u201d, and returns the count.
\nAnswer:<\/p>\n

Question 21.
\nGiven the following code [2]<\/p>\n

d={ \u2018Bed\u2019 :145000, \u2018Almirah\u2019 :9000, \u2018Chair\u2019 :1000}\r\nfor v in d.keys( ):\r\nif d[v]>100000 :\r\nd[v]- =10000\r\nprint(d)<\/pre>\n

What will be the output of the print statement?
\nOr
\nFind the output of following code<\/p>\n

Name= PythoN3@1\u201d\r\nR = \" \"\r\nfor x in range(len(Name)):\r\nif Name[x].isuppero:\r\nR=R+Name[x].lower( )\r\nelif Name[x].islower( ):\r\nR=R+Name[x].upper( )\r\nelif Narne[x].isdigit( ):\r\nelse:\r\nR=R+\"#\"\r\nprint(R)\r\nAnswer:\r\n{\u2018Bed\u2019: 135000, \u2018Almirah\u2019: 9000, Chair: 1000}\r\nOr\r\npYTHOnN#@<\/pre>\n

\"CBSE<\/p>\n

Question 22.
\nExplain database and DBMS in detail. [2]
\nOr
\nDifferentiate between char(n) and varchar(n) data types with respect to databases.
\nAnswer:
\nDatabase The database is a shared collection of logically related data, designed to meet the information needs of an organisation. A database is a computer based record keeping system whose over aH purpose is to record and maintains information.
\nDBMS A Database Management System (DBMS) is a collection of programs that enables users to store, modify and
\nxtract information from a database as per the requirements. It acts as an interface between the application program and the operating system to access or manipulate the database.<\/p>\n

Or<\/p>\n

Differentiate between char(n) and varchar(n) are as follows<\/p>\n\n\n\n\n\n\n
char(n)<\/td>\nvarchar(n)<\/td>\n<\/tr>\n
It stores a fixed length string between 1 and 255 characters.<\/td>\nIt stores a variable length string.<\/td>\n<\/tr>\n
If the value is of smaller length, then it adds blank spaces.<\/td>\nNo blanks are added by varchar(n) even if value is of smaller length.<\/td>\n<\/tr>\n
Some space is wasted in it.<\/td>\nNo wastage of space in varchar(n).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Question 23.
\n(a) What is the minimum number of iterations that while( ) loop could make? [2]
\n(b) Write an appropriate loop for the condition a loop is to be repeated loo times.
\nAnswer:
\n(a) while() loop could make minimum 0 iteration.
\n(b) f0r i in range (0, 100, +1);<\/p>\n

Question 24.
\nWhat output will the following code produce? [2]<\/p>\n

y=str( 123)\r\nx=\"hello\"*3\r\nprint(x,y)\r\nx=\u201dhello\" + world\u201d\r\ny=len(x)\r\nprint(y,x)<\/pre>\n

Or<\/p>\n

Write function names for the following with respect to strings.
\n(a) To make the first letter of a string in capital.
\n(b) To find the index of the 1st occurrence of a string in another.
\nAnswer:
\nhellohellohello 123 .
\n10 helloworld<\/p>\n

Or<\/p>\n

(a) capitalize() Returns a copy of the string with the 1st character capitalized.
\n(b) find() Returns the lowest index in a string where another string is found.<\/p>\n

Question 25.
\nDetermine the hierarchy of operations and evaluate following expression.
\nA = 3*4\/\/5+5\/,7+8\u20142 +4\/12
\nAnswer:
\nThe * operator will be performed before II. Though both have same priority but in this expression * is prior to \/\/.
\nA = 3*4\/\/5 + 5\/\/7 +8-2+4\/\/2
\n= 12\/\/5+5\/\/17+8\u20142+4\/\/2
\n= 2+ 5\/\/7 + 8\u20142+ 4\/\/2 operation : \/\/
\n=2+0+8\u20142+4\/2 operation:\/\/
\n= 2+ 0+ 8-2+2 operation : \/\/
\n= 2+0+6+2 operation:-
\n= 10<\/p>\n

Section – C<\/span><\/p>\n

Question 26.
\nWith respect to the table PAYMENTS given below , write output of the following questions. [1 \u00d7 3 = 3]
\nTABLE : PAYMENTS
\n\"CBSE
\n(i) To display the average of employees salary from PAYMENTS table.
\n(ii) To count the total number of employees from PAYMENTS table Department wise
\n(iii) To count distinct values of column Department from PAYMENTS table.
\nAnswer:
\nSELECT AVG(Salary) FROM PAYMENTS;
\n(ii) SELECT Department ,COUNT(*) FROM PAYMENTS GROUP BY Department:
\n(iii) SELECT COUNT(DISTINCT Department) FROM PAYMENTS;<\/p>\n

Question 27.
\nWrite a code in Python to open a Binary file \u201cCollege.dat\u201d containing records of students as per following structure. [3]
\nRoll Name SemPercentage
\nThe code should display only records of students from the file where the percentage is greater than 30.
\nOr
\nWrite a method countopen( ) to count and display the number of lines starting with the word \u2018OPEN\u2019(including lower cases and upper cases) present in a text file “start, txt\u201d.
\ne.g. If the file \u201cstart.txt\u201d contains the following lines:
\nGet the data value to be deleted;
\nOpen the file for reading from it.
\nRead the complete file into a list
\nDelete the data from the list
\nOpen the file
\nOpen same file for writing into it
\nWrite the modified list into file.
\nClose the file.
\nThe method should display
\nTotal lines started with word \u2018OPEN\u2019 is\/are: [3]
\nAnswer:<\/p>\n

stud=[]\r\nf_open(\"College.dat\", \"rb\u201d)\r\nwhile True:\r\ntry:\r\nstud=pickle. load(f)\r\nif stud[2]>30:\r\nprint(stud)\r\nexcept EOFError:\r\nprint(\"End of file\")\r\nbreak\r\nf.close()<\/pre>\n

Or<\/p>\n

import os\r\ndef countopen( ):\r\nif os.path.isfile(\u201dstart.txt\u201d):\r\nf=open(\u201dstart .txt\u201d, \u201cr\u201d)\r\nc=0\r\nprint(\u201dThe lines are:\u201d)\r\nwhile True:\r\nl=f.readline( )\r\nl=l.rstrip( )\r\nprint (l)\r\nif not 1:\r\nbreak\r\nlist1=l.upper( ).split( )\r\nif(list1[0]==\u2019OPEN\u2019 ):\r\nc=c+1\r\nif(c>0):\r\nprint(\u201dTotal lines started with the word \u2018OPEN\u2019 is\/are:\u201d, c)\r\nelse:\r\nprint(\u201dThere is no line started with the word OPEN \u201c)\r\nf.close()\r\nelse:\r\nprint(\u201dFile does not exist\u201d)<\/pre>\n

\"CBSE<\/p>\n

Question 28.
\nWrite SQL commands from (i) to (iii) on the basis of the table INTERIORS given below [1 \u00d7 3 = 3]
\nTABLE: INTERIORS
\n\"CBSE
\n\"CBSE
\n(i) To show all information about the Sofa from the INTERIORS table.
\n(ii) To list the ITEMNAME, which are priced at more than 10000 from the INTERIORS table.
\n(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.
\nAnswer:
\n(i) SELECT * FROM INTERIORS WHERE TYPE = \u2018Sofa\u2019:
\n(ii) SELECT ITEMNAME FROM INTERIORS WHERE PRICE > 10000;
\n(iii) SELECT ITEMNAME, TYPE FROM INTERIORS WHERE DATEOFSTOCK < \u201822\/01\/02\u2019 ORDER BY ITEMNAME DESC;<\/p>\n

Question 29.
\nWrite a user defined function to accept a string and check whether it is palindrome or not.
\n(A palindrome is a string that is same as its reverse) [3]
\nAnswer:
\ndef checkPal in():
\nstring = input (\u201cEnter the string:\u201d)
\nstr1 = ” ”
\nfor i in string:
\nstr1 = i + str1
\nprint (\u201cstring in reverse order:\u201d, str1)
\nif (string == str1):
\nprint (\u201cThis is a palindrome string\u201d)
\nelse :
\nprint (\u201cThis is not a palindrome string\u201d)<\/p>\n

Question 30.
\nExplain the traversal operation in a stack. [3]
\nWrite the algorithm for Traversal of a stack to display its contents.
\nYou need not to write the actual code.
\nAnswer:
\nMoving through the elements of the stack is known as traversal. Traversing is the basic operation to display elements in a stack.
\nAlgorithm Steps to Display all the Elements of the Stack<\/p>\n

    \n
  1. Start<\/li>\n
  2. if (Top = – 1) go to step 3
    \nelse go to step 4<\/li>\n
  3. Print \u201cStack is empty\u201d and go to step 7<\/li>\n
  4. Print the Top element of the stack<\/li>\n
  5. Decrement Top by 1<\/li>\n
  6. if (Top = – 1) go to step 7
    \nelse go to step 4<\/li>\n
  7. Stop<\/li>\n<\/ol>\n

    Section – D<\/span><\/p>\n

    Question 31.
    \nConsider the following table [1 \u00d7 4 = 4]
    \nTABLE:INTERIORS
    \n\"CBSE
    \nWrite statements to
    \n(a) Write a command to display only the Column ITEMNAME , Net Amount(PRICE- DISCOUNT)
    \n(b) Display only ITEMNAME and Discount column.
    \n(c) Which clause is to be used to search non blank values in the table?
    \n(d) Which command will be used to make the “No\u201d column as the primary key?
    \nAnswer:
    \n(a) SELECT ITEMNAME, PRICE-DISCOUNT AS \u201cNet Amount\u201d FROM INTERIORS;
    \n(b) SELECT ITEMNAME, DISCOUNT FROM INTERIORS;
    \n(c) NOT NULL
    \n(d) ALTER TABLE INTERIORS ADD Primary key(No);<\/p>\n

    Question 32.
    \nA binary file \u201cTelephone.dat\u201d exists storing details of BSNL customers as per following structure. [4]
    \nPhoneNo CustomerName ConnType
    \nWrite a program in Python for adding and displaying record count from the binary file using following functions
    \nNewCustomer() To add data of customers to the binary file \u201cTelephone.dat”.
    \nNote : The existing connection data should be preserved.
    \nPrintConnections() To open the file “Telephone.dat” and display the connections and number of connections.
    \nAnswer:<\/p>\n

    import pickle\r\ndef NewCustomerl) :\r\nf=open(\"Telephone.dat\",\"ab\")\r\nans='y'\r\npno=\"\"\r\ncname=\"\"\r\nctype=\u201d\u201d\r\nwhile ans=='y':\r\npno=input(\"Enter telephone number ,\u201d)\r\ncname=input(\"Enter customer name \")\r\nctype=input(\"Enter connection Type\")\r\nphone1st=[pno,cname,ctype]\r\npickle.dump(phonelst, f)\r\nans=input(\"Continue(y\/n)\")\r\nf .close()\r\ndef PrintConnections( );\r\nf=open(\"Telephone.dat\",\"rb\")\r\nwhile True:\r\ntry:\r\nphonelst=pickle.load(f)\r\nprint(\"Phone No.:\" phonelst[0])\r\nprint(\"Customer Name : \"phonelst[1])\r\nprint(\u201cConnection Type phonelst[2])\r\nexcept EOFError:\r\nprint(\"End of file\")\r\nbreak\r\nf.close()\r\nNewCustomer( )\r\nPrintConnections( )<\/pre>\n

    Section – E<\/span><\/p>\n

    Question 33.
    \nTech 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 \u00d7 5 = 5]
    \n\"CBSE
    \n(a) What will the most appropriate block, where TUC should plan to install their server?
    \n(b) Draw a block to block cable layout to connect all the buildings in the most appropriate manner for efficient communication.
    \n(c) Write names of different types of Modems.
    \n(d) Which of the following devices will be suggested by you to connect each computer in each of the buildings?
    \n(i) Gateway
    \n(ii) Switch
    \n(iii) Modem
    \n(e) Company is planning to connect its Block in Hyderabad which is more than 20 km. Which type of network will be formed?
    \nAnswer:
    \n(a) TUC should install its server in Human Resource Block as it has maximum number of computers.
    \n(b)
    \n\"CBSE
    \nThe above layout is based on the minimum length of cable required, i.e. 140 m.
    \n(c) Internal Modem : Fixed inside the computer.
    \nExternal Modem : Attached externally to a computer
    \n(d) (ii) Switch
    \n(e) MAN<\/p>\n

    \"CBSE<\/p>\n

    Question 34.
    \n(a) What is DDL? Explain with its commands. [1 + 4 = 5]
    \n(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 :
    \nRollNo Name Class Perc
    \nNote:
    \nDatabase :PythonDB
    \nTable: Student
    \nHost: localhost
    \nUserId:root
    \nPassword: arihant<\/p>\n

    Or<\/p>\n

    (a) What is DML? Explain with its commands.
    \n(b) Write a code in Python to delete the record of a student whose rollno is 33.
    \nThe table structure is as follows
    \nRollNo Name Class Perc
    \nNote :
    \nDatabase :PythonDB
    \nTable: Student
    \nHost: localhost
    \nUserId:root
    \nPassword: arihant
    \nAnswer:
    \n(a) DDL (Data Definition Language) provides statements for creation and deletion of the database tables, views, etc. The DDL provides a set of definitions to specify the storage structure in a database system.
    \nSome DDL statements are as follows<\/p>\n

      \n
    1. CREATE used to create new table in the database.<\/li>\n
    2. DROP used to delete tables from the database.<\/li>\n
    3. ALTER used to change the structure of the database table. This statement can add up additional column, drop existing, and even change the data type of columns involved in a database table.<\/li>\n
    4. RENAME used to rename a table.<\/li>\n<\/ol>\n

      (b)<\/p>\n

      import mysql.connector\r\ncon = mysql.connector.connect\r\n(host = \u201clocalhost\u201d, user = \u201croot\", passwd = \u201carihant\u201d, database = \u201cPythonDB\u201d)\r\ncursor = con.cursor( )\r\ntry :\r\ncursor.execute (\u201cupdate Student set Class = 12 where RollNo = 22\u201d)\r\ncon.commit( )\r\nexcept :\r\ncon.rollback()\r\ncon.close()<\/pre>\n

      Or<\/p>\n

      (a) DML (Data Manipulation Language) provides statements for manipulating the database objects. It is used to query the databases for information retrieval. Some DML statements are as follows
      \n(i) iNSERT used to insert data into a table.
      \n(ii) SELECT used to retrieve data from a database.
      \n(iii) UPDATE used to update existing data within a table.
      \n(iv) DELETE used to delete all records from a table.<\/p>\n

      (b)<\/p>\n

      import mysql.connector\r\ncon = mysql.connector.connect\r\n(host = \u201clocalhost\u201d, user = \u201croot\u201d,\r\npasswd = \u201cariharit\u201d,\r\ndatabase = \u201cPythonDB\u201d)\r\ncursor = con.cursor( )\r\ntry :\r\ncursor.execute (\u201cupdate Student set Class = 12 where RollNo = 22\u201d)\r\ncon.commit( )\r\nexcept :\r\ncon.rollback( )\r\ncon.close( )<\/pre>\n

      Question 35.
      \n(a) What is the use of writerows() function for CSV files? [2 + 3=5]
      \n(b) A binary file “Hotel.dat” exists storing details of hotel customers as per following structure:
      \nRoomId CustomerName Days
      \nWrite a program in Python for adding and displaying records from the binary file using following functions
      \nReserve() To add data of customers to the binary file.
      \nShowReservations() To open the file “Hotel.dat” and display all the records.
      \nOr
      \n(a) What is csv. reader() function?
      \n(b) Write a program in Python to modify records of a binary file \u201chotel.dat\u201d 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.
      \nThe file structure is
      \nRoomId Customer Name Days
      \nAnswer:
      \n(a) writerows function writes multiple rows (sequence) to the writer\u2019s file object.<\/p>\n

      (b)<\/p>\n

      import pickle\r\ndef Reserve( ) :\r\nf=open(\"Hotel .dat\u201d,\u201dwb\u201d)\r\nans='y'\r\nroomid=\u201d \u201d\r\ncname=\" \"\r\nday =\" \"\r\nwhile ans==\u2019y\u2019:\r\nroomid=input(\u201dEnter room id\u201d)\r\ncname=input(\u201dEnter customer name \u201c)\r\ndays=input(\u201dEnter days\u201d)\r\nhotel lst=[roomid, cname ,days]\r\npickle.dump(hotel lst, f)\r\nans=input( \u201cContinue(y\/n)\u201d)\r\nf.close()\r\ndef ShowReservations( ):\r\nf=open(\u201dHotel.dat\u201d, \u201crb\u201d)\r\nwhile True:\r\ntry:\r\nlst=pickle.load(f)\r\nprint(\u201dRoom ID :\u201clst[O])\r\nprint(\u201dCustomer Name :\u201c,lst[1])\r\nprint(\u201dDays :\u201c,lst[2])\r\nexcept EOFError:\r\nprint(\u201dNo more records\u201d)\r\nbreak\r\nf.close()\r\nReserve()\r\nShowReservations()<\/pre>\n

      Or<\/p>\n

      (b)<\/p>\n

      import pickle\r\nlst =[]\r\nf=open( \u201chotel .dat\u201d.\u201d rb+\u201d)\r\nans='y\u2019\r\nwhile ans==\u2019y\u2019:\r\nr=int(input(\u201dEnter roomid to modify :\u201c))\r\n1st=pickle.load(f)\r\nsize=f.tell( )\r\nf.seek(0)\r\nf.seek((r-1)*Size)\r\n1st=pickle.load(f )\r\nprint(\u201dold record\u201c)\r\nprint(\u201dRoom Id :\u201c , lst[0])\r\nprint(\u201dCustomer :\u201c, lst[1])\r\nprint(\u201dDays :\u201c,lst[2])\r\nf.seek(0)\r\nf.seek((r-1)*size)\r\nprint(\u201dEnter new record \u201c)\r\nnm=input(\u201dEnter customer name :\u201c)\r\ndays=input(\u201dEnter days :\u201c)\r\nrs=str(r)\r\nlst=[rs,nm, days]\r\npickle.dump(lst,f)\r\nans=input(\u201dModify another(y\/n)\u201d)\r\nf.close()<\/pre>\n","protected":false},"excerpt":{"rendered":"

      Students must start practicing the questions from\u00a0CBSE Sample Papers for Class 12 Computer Science with Solutions Set 6 are designed as per the revised syllabus. CBSE Sample Papers for Class 12 Computer Science Set 6 with Solutions Time: 3 hrs Max. Marks: 70 Instructions 1. Please check this question paper contains 35 questions. 2. The […]<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":""},"categories":[84911],"tags":[],"yoast_head":"\nCBSE Sample Papers for Class 12 Computer Science Set 6 with Solutions - Learn CBSE<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CBSE Sample Papers for Class 12 Computer Science Set 6 with Solutions\" \/>\n<meta property=\"og:description\" content=\"Students must start practicing the questions from\u00a0CBSE Sample Papers for Class 12 Computer Science with Solutions Set 6 are designed as per the revised syllabus. CBSE Sample Papers for Class 12 Computer Science Set 6 with Solutions Time: 3 hrs Max. Marks: 70 Instructions 1. Please check this question paper contains 35 questions. 2. The […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/\" \/>\n<meta property=\"og:site_name\" content=\"Learn CBSE\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ncertsolutionsbooks\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-04T04:00:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-04T06:10:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.learncbse.in\/wp-content\/uploads\/2023\/12\/Learn-CBSE.png\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<meta name=\"twitter:creator\" content=\"@learncbse\" \/>\n<meta name=\"twitter:site\" content=\"@learncbse\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sastry CBSE\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"16 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.learncbse.in\/#organization\",\"name\":\"LearnCBSE\",\"url\":\"https:\/\/www.learncbse.in\/\",\"sameAs\":[\"https:\/\/www.facebook.com\/ncertsolutionsbooks\/\",\"https:\/\/www.instagram.com\/learncbse.in\/\",\"https:\/\/www.youtube.com\/user\/CBSEPapers\",\"https:\/\/in.pinterest.com\/learncbsein\/\",\"https:\/\/twitter.com\/learncbse\"],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.learncbse.in\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.learncbse.in\/wp-content\/uploads\/2017\/01\/LearnCBSE.in_.png\",\"contentUrl\":\"https:\/\/www.learncbse.in\/wp-content\/uploads\/2017\/01\/LearnCBSE.in_.png\",\"width\":210,\"height\":198,\"caption\":\"LearnCBSE\"},\"image\":{\"@id\":\"https:\/\/www.learncbse.in\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.learncbse.in\/#website\",\"url\":\"https:\/\/www.learncbse.in\/\",\"name\":\"Learn CBSE\",\"description\":\"NCERT Solutions for Class 6, 7, 8, 9, 10, 11 and 12\",\"publisher\":{\"@id\":\"https:\/\/www.learncbse.in\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.learncbse.in\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.learncbse.in\/wp-content\/uploads\/2023\/12\/Learn-CBSE.png\",\"contentUrl\":\"https:\/\/www.learncbse.in\/wp-content\/uploads\/2023\/12\/Learn-CBSE.png\",\"width\":116,\"height\":16,\"caption\":\"Learn CBSE\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#webpage\",\"url\":\"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/\",\"name\":\"CBSE Sample Papers for Class 12 Computer Science Set 6 with Solutions - Learn CBSE\",\"isPartOf\":{\"@id\":\"https:\/\/www.learncbse.in\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#primaryimage\"},\"datePublished\":\"2024-01-04T04:00:52+00:00\",\"dateModified\":\"2024-01-04T06:10:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.learncbse.in\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CBSE Sample Papers for Class 12 Computer Science Set 6 with Solutions\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#webpage\"},\"author\":{\"@id\":\"https:\/\/www.learncbse.in\/#\/schema\/person\/61b9daccbdd8635544055b7568d50f43\"},\"headline\":\"CBSE Sample Papers for Class 12 Computer Science Set 6 with Solutions\",\"datePublished\":\"2024-01-04T04:00:52+00:00\",\"dateModified\":\"2024-01-04T06:10:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#webpage\"},\"wordCount\":2482,\"publisher\":{\"@id\":\"https:\/\/www.learncbse.in\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.learncbse.in\/wp-content\/uploads\/2023\/12\/Learn-CBSE.png\",\"articleSection\":[\"CBSE Sample Papers\"],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.learncbse.in\/#\/schema\/person\/61b9daccbdd8635544055b7568d50f43\",\"name\":\"Sastry CBSE\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.learncbse.in\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d97564d7fa0c644fd231068e890b0736?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d97564d7fa0c644fd231068e890b0736?s=96&d=mm&r=g\",\"caption\":\"Sastry CBSE\"},\"sameAs\":[\"http:\/\/www.recruitmenttopper.com\/\"],\"url\":\"https:\/\/www.learncbse.in\/author\/sastry-cbse\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"CBSE Sample Papers for Class 12 Computer Science Set 6 with Solutions - Learn CBSE","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/","og_locale":"en_US","og_type":"article","og_title":"CBSE Sample Papers for Class 12 Computer Science Set 6 with Solutions","og_description":"Students must start practicing the questions from\u00a0CBSE Sample Papers for Class 12 Computer Science with Solutions Set 6 are designed as per the revised syllabus. CBSE Sample Papers for Class 12 Computer Science Set 6 with Solutions Time: 3 hrs Max. Marks: 70 Instructions 1. Please check this question paper contains 35 questions. 2. The […]","og_url":"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/","og_site_name":"Learn CBSE","article_publisher":"https:\/\/www.facebook.com\/ncertsolutionsbooks\/","article_published_time":"2024-01-04T04:00:52+00:00","article_modified_time":"2024-01-04T06:10:13+00:00","og_image":[{"url":"https:\/\/www.learncbse.in\/wp-content\/uploads\/2023\/12\/Learn-CBSE.png"}],"twitter_card":"summary","twitter_creator":"@learncbse","twitter_site":"@learncbse","twitter_misc":{"Written by":"Sastry CBSE","Est. reading time":"16 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/www.learncbse.in\/#organization","name":"LearnCBSE","url":"https:\/\/www.learncbse.in\/","sameAs":["https:\/\/www.facebook.com\/ncertsolutionsbooks\/","https:\/\/www.instagram.com\/learncbse.in\/","https:\/\/www.youtube.com\/user\/CBSEPapers","https:\/\/in.pinterest.com\/learncbsein\/","https:\/\/twitter.com\/learncbse"],"logo":{"@type":"ImageObject","@id":"https:\/\/www.learncbse.in\/#logo","inLanguage":"en-US","url":"https:\/\/www.learncbse.in\/wp-content\/uploads\/2017\/01\/LearnCBSE.in_.png","contentUrl":"https:\/\/www.learncbse.in\/wp-content\/uploads\/2017\/01\/LearnCBSE.in_.png","width":210,"height":198,"caption":"LearnCBSE"},"image":{"@id":"https:\/\/www.learncbse.in\/#logo"}},{"@type":"WebSite","@id":"https:\/\/www.learncbse.in\/#website","url":"https:\/\/www.learncbse.in\/","name":"Learn CBSE","description":"NCERT Solutions for Class 6, 7, 8, 9, 10, 11 and 12","publisher":{"@id":"https:\/\/www.learncbse.in\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.learncbse.in\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#primaryimage","inLanguage":"en-US","url":"https:\/\/www.learncbse.in\/wp-content\/uploads\/2023\/12\/Learn-CBSE.png","contentUrl":"https:\/\/www.learncbse.in\/wp-content\/uploads\/2023\/12\/Learn-CBSE.png","width":116,"height":16,"caption":"Learn CBSE"},{"@type":"WebPage","@id":"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#webpage","url":"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/","name":"CBSE Sample Papers for Class 12 Computer Science Set 6 with Solutions - Learn CBSE","isPartOf":{"@id":"https:\/\/www.learncbse.in\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#primaryimage"},"datePublished":"2024-01-04T04:00:52+00:00","dateModified":"2024-01-04T06:10:13+00:00","breadcrumb":{"@id":"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.learncbse.in\/"},{"@type":"ListItem","position":2,"name":"CBSE Sample Papers for Class 12 Computer Science Set 6 with Solutions"}]},{"@type":"Article","@id":"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#article","isPartOf":{"@id":"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#webpage"},"author":{"@id":"https:\/\/www.learncbse.in\/#\/schema\/person\/61b9daccbdd8635544055b7568d50f43"},"headline":"CBSE Sample Papers for Class 12 Computer Science Set 6 with Solutions","datePublished":"2024-01-04T04:00:52+00:00","dateModified":"2024-01-04T06:10:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#webpage"},"wordCount":2482,"publisher":{"@id":"https:\/\/www.learncbse.in\/#organization"},"image":{"@id":"https:\/\/www.learncbse.in\/cbse-sample-papers-for-class-12-computer-science-set-6\/#primaryimage"},"thumbnailUrl":"https:\/\/www.learncbse.in\/wp-content\/uploads\/2023\/12\/Learn-CBSE.png","articleSection":["CBSE Sample Papers"],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.learncbse.in\/#\/schema\/person\/61b9daccbdd8635544055b7568d50f43","name":"Sastry CBSE","image":{"@type":"ImageObject","@id":"https:\/\/www.learncbse.in\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/d97564d7fa0c644fd231068e890b0736?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d97564d7fa0c644fd231068e890b0736?s=96&d=mm&r=g","caption":"Sastry CBSE"},"sameAs":["http:\/\/www.recruitmenttopper.com\/"],"url":"https:\/\/www.learncbse.in\/author\/sastry-cbse\/"}]}},"_links":{"self":[{"href":"https:\/\/www.learncbse.in\/wp-json\/wp\/v2\/posts\/156593"}],"collection":[{"href":"https:\/\/www.learncbse.in\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.learncbse.in\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.learncbse.in\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.learncbse.in\/wp-json\/wp\/v2\/comments?post=156593"}],"version-history":[{"count":9,"href":"https:\/\/www.learncbse.in\/wp-json\/wp\/v2\/posts\/156593\/revisions"}],"predecessor-version":[{"id":156837,"href":"https:\/\/www.learncbse.in\/wp-json\/wp\/v2\/posts\/156593\/revisions\/156837"}],"wp:attachment":[{"href":"https:\/\/www.learncbse.in\/wp-json\/wp\/v2\/media?parent=156593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.learncbse.in\/wp-json\/wp\/v2\/categories?post=156593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.learncbse.in\/wp-json\/wp\/v2\/tags?post=156593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}