Skip to main content
Open navigation menu
Close suggestions
Search
Search
en
Change Language, English
Upload
Sign in
Sign in
0 ratings
0% found this document useful (0 votes)
18 views
16 pages
91 Computer Science
Ttttt
Uploaded by
GURNOOR s
AI-enhanced title
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save 91_Computer_Science For Later
Share
0%
0% found this document useful, Mark this document as useful
0%
0% found this document not useful, Mark this document as not useful
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
18 views
16 pages
91 Computer Science
Ttttt
Uploaded by
GURNOOR s
AI-enhanced title
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Go to previous items
Download
Save
Save 91_Computer_Science For Later
Share
0%
0% found this document useful, Mark this document as useful
0%
0% found this document not useful, Mark this document as not useful
Print
Embed
Report
Go to next items
Download
Save 91_Computer_Science For Later
Share
More options
Fullscreen
Bia SETS | Series LHEFG Wa-w ais ra QP. Code 91% Roll No. Candidates must write the Q.P. Code on the title page of the answer-book. COMPUTER SCIENCE } Time allowed : 2 hours Maximum Marks : 70 Please check that this question paper contains 15 printed pages 5 © QP. Code given on the right hand side of the question paper should be {} written on the title page of the answer-book by the candidate. 76 © Please check that this question paper contains 35 questions. ; @ Please write down the serial number of the question in the answer- book before attempting it. © 15 minute time has been allotted to read this question paper. The question paper will be distributed at 10.15 a.m. From 10.15 a.m. to 10.30 ? a.m., the candidates will read the question paper only and will not write any answer on the answer-book during this period. — TITAS ITA ATTA AT ITA AT ISAT TATA TATA ISAT ITA TAT ITAA TITAS bee . EEO
ae P.O.General Instructions : a 91 (i) This question paper contains five sections, Section A to E. (ii) All questions are compulsory. (iii) Section A have 18 questions carrying 1 mark each. (iv) Section B has 7 Very Short Answer type questions carrying 2 marks each. (v) Section C has 5 Short Answer type questions carrying 3 marks each. (vi) Section D has 3 Long Answer type questions carrying 5 marks each. (vii) Section E has 2 questions carrying 4 marks each. One internal choice is given in Q. 34 and 35, against Part (iii) only. (viii)AU programming questions are to be answered using Python Language only. SECTION - A State True or False. 1 “Identifiers are names used to identify a variable, function in a program” Which of the following is a valid keyword in Python ? 1 (a) false (b) return (©) non_local (@) none Given the following Tuple 1 Tup= (10, 20, 30, 50) Which of the following statements will result in an error ? (a) print (Tup[0]) t (2,3) (©) print (Pup[1:2)) len (Tup) } Consider the given expression : 5<10 and 12>7 or not 7>4 Which of the following will be the correct output, if the given expression is evaluated ? 1 (a) True (b) Fal. (©) NONE (d) NULL Select the correct output of the code : 1 "Amrit Mahotsav @ 75" partition ("") <>a 10. 11. 12. 91 Which of the following mode keeps the file offset position at the end of the file ? (@) x (b) © w @ a Fill in the blank. function is used to arrange the elements of a list in ascending order. (a) sort () (b) arrange () (©) ascending() (@) asort() Which of the following operators will return either True or False ? (@) + ) ! © = @) + Which of the following statement(s) would give an error after executing the following code ? "Murugan":100, "Mithu":95} # (Stud[ ) # "Muri ")=99 # print (Stud. pop ()} f print (Stud) # (a) Statement 2 (b) Statement 3 (©) Statement 4 (@) Statements 2 and 4 Fill in the blank. _____ is a number of tuples in a relation. (a) Attribute (b) Degree (©) Domain (@) cardinality erence_point]) What is the default value of reference_point ? fa) 0 (b) 1 © 2 @ 3 Fill in the blank clause is used with SELECT statement to display data in a sorted form with respect to a specified column. (a) WHERE (b) oR (ce) HAV: (d) DISTINCT <=> P.T.O.13. 14, 16. 17. 91 Fill in the blank : is used for point-to-point communication or unicast communication such as radar and satellite. (a) INFRARED WAVES (b) BLUETOOTH (c) MICROWAVES (ad) RADIOWAVES What will the following expression be evaluated to in Python ? nt (4+3*5/3-5%2) (a) 8.5 (b) 8.0 () 10.2 (d) 10.0 Which function returns the sum of all elements of a list ? (a) count () (b) sum() (©) total() (d) add() fetchall() method fetches all rows in a result set and returns a : (a) Tuple of lists ) 1 () List of strings (@ tuple of strings of tuples Q. 17 and 18 are ASSERTION (A) and REASONING (R) based questions. Mark the correct choice as (a) Both (A) and (R) are true and (R) is the correct explanation for (A). (b) Both (A) and (R) are true and (R) is not the correct explanation for (a). (© (A) is true but (R) is false. (@ (A) is false but (R) is true. Assertion (A) : To use a function from a particular module, we need to import the module. Reason (R) : import statement can be written anywhere in the program, before using a function from that module. Assertion (A) : A stack is a LIFO structure Reason (R) : Any new clement pushed into the stack always gets positioned at the index after the last existing element in the stack. <>19. 20. 21. 22. 23. 24. 91 SECTION - B Atharva is a Python programmer working on a program to find and return the maximum value from the list. The code written below has syntactical errors, Rewrite the correct code and underline the corrections made. 2 def max_num (L) max=L(0) for a in L if a > max max=a return max (a) Differentiate between wired and wireless transmission. 2 OR (b) Differentiate between URL and domain name with the help of an appropriate example. 2 (a) Given is a Python list declaration : 1 Listofnames=["Aman", "Ankit", "A: Write the output of print (Listofnames [-1: nish", "Rajan", "Rajat"] 1)) (b) Consider the following tuple declaration : 1 tupi=(10, 20,30, (10,20,30),40) Write the output of : nt ([Link](20)) Explain the concept of “Alternate Key” in a Relational Database Management System with an appropriate example. 2 (a) Write the full forms of the following 2 @) HTML Gi) TCP (b) What is the need of Protocols ? (a) Write the output of the code given below : 2 def short_sub (1st,n) for i in range (0,n) £ len (1st}>4: Ist [iJ-lst [iJ+lst(il else: ist [i]=lst[i] "cS", 'HINDI', "PHYSICS", ‘CHEMISTRY’, 'MATHS"] t,5) subje short_sub(subjec print (subject) OR <> P.T.O.) b) 26. (a) 91 Write the output of the code given below : 2 a =30 def call (x) global a x=20 print ( 1(35),end="#") print (call (40),end= "@") Differentiate between CHAR and VARCHAR data types in SQL with appropriate example. 2 OR Name any two DDL and any two DML commands. 2 SECTION - C Consider the following tables — LOAN and BORROWER : 1+2 Table : LOAN LOAN_NO | B_NAME AMOUNT L-170 DELHI 3000 L-230 KANPUR __| 4000 Table : BORROWER CUST_NAME | LOAN_NO JOHN L-171 KRISH L-230 RAVYA L-170 How many rows and columns will be there in the natural join of these two tables ?27. 91 b) (a) Write the output of the queries (i) to (iv) based on the table, WORKER given below TABLE: WORKER W_ID | F_NAME L_NAME CITY STATE 102 SAHIL KHAN KANPUR UTTAR PRADESH 104__|SAMEER __| PARIKH ROOP NAGAR _| PUNJAB 105 MARY JONES DELHI DELHI 106 MAHIR SHARMA SONIPAT. HARYANA 107 ATHARVA | BHARDWAJ | DELHI DELHI 108 VEDA SHARMA KANPUR UTTAR PRADESH @ LECT F_NAME, CITY FROM WORK ORDER BY STATE SCF (i) SELE Gi) SELECT LIKE '_HAS'; (iv) SELECT CITY, COUNT(*) FROM WORKER GROUP BY TY) FROM WORKER; FROM WORKER WHERE L_NAME nya Write the definition of a Python function named LongLines( ) which reads the contents of a text file named '[Link]' and displays those lines from the file which have at least 10 words in it. For example, if the content of ' [Link]! is as follows : 3 Once upon a time, there was a woodcutter He lived in a little house in a beautiful, green wood. One day, he was merrily chopping some wood. He saw a little girl skipping through the woods, whistling happily. The girl was followed by a big gray wolf. Then the function should display output as He lived in a little house in a beautiful, green wood. He saw a little girl skipping through the woods, whistling happily. OR <> P.T.O.(b) Write a function count_Dwords() in Python to count the words ending with a digit in a text file "[Link]". Example: If the file content is as follows On seat2 VIP1 will sit and On seat1 VVIP2 will be sitting Output will be: Number of words ending with a digit are 4 (a) Write the outputs of the SQL queries (i) to (iv) based on the relations COMPUTER and SALES given below Table : COMPUTER: PROD_ID_| PROD NAME PRICE | COMPANY TYPE Pool MOUSE 200 LOGITECH | INPUT Po02 LASER PRINTER 4000 CANON OUTPUT P003 KEYBOARD 500 LOGITECH | INPUT P004 JOYSTICK 1000 IBALL INPUT P005 SPEAKER 1200 CREATIVE OUTPUT Po06 DESKJET PRINTER | 4300 CANON OUTPUT Table : SALES PROD_ID | QTY_SOLD | QUARTER Po02 4 1 P0038 2 2 P0011 3 2 Po04 2 1 (i) SELECT MIN(PRICE]), MAX(PRICE] FROM COMPUTER; Gi) COMPANY, COUNT (*) HAVING COUNT (COMP; ROM COMPUTER )> 17 OUP BY (iii) s Y_SOLD FROM COMPU ER C, D AND TYPE = "INPUT"; OM COMPUTER (iv) SELECT C, SALES § (b) Write the command to view all databases. <>29. 30. 91 Write a function EOReplace) in Python, which accepts a list L of numbers. Thereafter, it increments all even numbers by 1 and decrements all odd numbers by 1. Example : If Sample Input data of the list is : L=[10,20,30,40,35,55] Output will be : L=[11,21,31,41,34,54] (a) (b) A list contains following record of customer: [Customer name, Room Type] Write the following user defined functions to perform given operations on the stack named "Hotel" (i) Push_Cust () — To Push customers’ names of those customers who are staying in ‘Delux’ Room Type. (ii) Pop_Cust () — To Pop the names of customers from the stack and display them. Also, display “Underflow” when there are no customers in the stack. For example : If the lists with customer details are as follows : ["Siddi ", "Delux" ["Rahul", "Standard"] ["Jerry", "Delux"] The stack should contain Jerry Siddharth The output should be: Jerry Siddharth Under flow OR Write a function in Python, Push (Vehicle) where, Vehicle is a dictionary containing details of vehicles — {Car Name: Maker} The function should push the name of car manufactured by ‘TATA’ (including all the possible cases like Tata, TaTa, etc.) to the stack. 3 For example: If the dictionary contains the following data: Vehicle= Hyundai", "Nexon The stack should contain "TATA", <> P.T.O.SECTION -D 31. Quickdev, an IT based firm, located in Delhi is planning to set up a network for its four branches within a city with its Marketing department in Kanpur. As a network professional, give solutions to the questions (i) to (v), after going through the branches locations and other details which are given below : DELHI BRANCH KANPUR BRANCH BRANCH A BRANCH B MARKETING DEPT. BRANCH C BRANCH D Distance between various branches is as follows : Branch Distance Branch A to Branch B 40m Branch A to Branch C 80m Branch A to Branch D 65 m Branch B to Branch C 30m Branch B to Branch D 35m Branch C to Branch D 15m Delhi Branch to Kanpur 300 km Number of computers in each of the branches Branch Number of Computers Branch A 15, Branch B 25 Branch C 40 Branch D 115 (@ Suggest the most suitable place to install the server for the Delhi branch with a suitable reason. 9132. 91 Gi) Gi) Gy) ) (a) b) Suggest an ideal layout for connecting all these branches within Delhi 1 Which device will you suggest, that should be placed in each of these branches to efficiently connect all the computers within these branches ? 1 Delhi firm is planning to connect to its Marketing department in Kanpur which is approximately 300 km away. Which type of network out of LAN, WAN or MAN will be formed ? Justify your answer. 1 Suggest a protocol that shall be needed to provide help for transferring of files between Delhi and Kanpur branch 1 What possible output(s) are expected to be displayed on screen at the time of execution of the following program import random M=[5,10,15,20,25, 30] for i in range (1,3): print (M[first],M[sec],M[third],sep="#”) @ 1o#25#15 Gi) 5#25#20 20825425 254204 (ii) 30820820 iv) 10#15425 20825425 15#204108 2 The code given below deletes the record from the table employee which contains the following record structure : E_code - String E_name - String Sal - Integer ty - String Note the following to establish connectivity between Python and MySQL * Username is root * Password is root * The table exists in a MySQL database named enp. © The details (E_code,£_name,Sal,City) are the attributes of the table. <> P.T.O.Write the following statements to complete the code : Statement 1 — to import the desired library. Statement 2 — to execute the command that deletes the record with E_code as ‘E101. Statement 3 — to delete the record permanently from the database. import as my: # Statemen def delete( ) mydb=mysql. conn host", user="root", passwd="root", dat mycursor=mydb. cursor ( # Statement 2 # Statement 3 int ("Record deleted") 3 oR (a) Predict the output of the code given below : def makenew (myst newstr="" count=0 for i in mystr: if counts2!=0: newstr=newstr+tstr (count) else if [Link]() newstr=newstr+[Link] (] lse: newstr=newstr+i count+=1 print (newstr) makenew ("No@1") 1 <=91 (b) The code given below reads the following records from the table employee and displays only those records who have employees coming from city ‘Delhi’ E code - String E_name - String Sa 1 + Integer City - String Note the following to establish connectivity between Python and MySQL : Username is root. Password is root The table exists in a MySQL database named emp. The details (E_code,E name, 5al,City) are the attributes of the table. Write the following statements to complete the code : Statement 1 — to import the desired library. Statement 2— to execute the query that fetches records of the employees coming from city ‘Delhi’. Statement 3 — to read the complete data of the query (rows whose city is Delhi) into the object named details, from the table employee in the database. import as mys # Statement 1 def display(): mydb=mysql .conne passwd= ocalhost",user="root", "root", database="emp") mycursor=mydb . cursor () detai for i 4 Statement 2 ls = 4 Statement 3 in deta print (i) P.T.O.33. (a) Write one difference between CSV and text files. Write a program in Python that defines and calls the following user defined functions () COURTER_ADD(): It takes the values from the user and adds the details to a csv file ‘courier v'. Each record consists of a list with field elements as cid, s name, Source, destination to store Courier ID, Sender name, Source and destination address respectively. (ii) COURIER SEARCH() : Takes the destination as the input and displays all the courier records going to that destination. OR (b) Why it is important to close a file before exiting ? Write a program in Python that defines and calls the following user defined functions : @) Add_Book() : Takes the details of the books and adds them to a csv file ‘[Link]’. Each record consists of a list with field elements as book ID, B_name and pub to store book ID, book name and publisher respectively. (i) Search Book() : Takes publisher name as input and counts and displays number of books published by them. SECTION -E 34. The school has asked their estate manager Mr. Rahul to maintain the 91 data of all the labs in a table LAB. Rahul has created a table and entered data of 5 labs. LABNO | LAB NAME | INCHARGE | CAPACITY | FLOOR L001 CHEMISTRY | Dais: 20 I L002 BIOLOGY Venky 20 IL L003 MATH Preeti 15 I L004 LANGUAGE | Daisy 36 Il L005, COMPUTER | Mary Kom _| 37 IL Based on the data given above answer the following questions : (i) Identify the columns which can be considered as Candidate keys. (ii) Write the degree and cardinality of the table. (iii) Write the statements to : (a) Insert a new row with appropriate data. (b) Increase the capacity of all the labs by 10 students which are on ‘T Floor. OR (Option for part (iii) only) (iii) Write the statements to : (a) Adda constraint PRIMARY KEY to the column LABNO in the table. (b) Delete the table LAB. we35. 91 Shreyas is a programmer, who has recently been given a task to write a user defined function named write _bin( ) to create a binary file called Cust_file.dat containing customer information — customer number (c_no}, name (c_name), quantity (qty), price (price) and amount (amt) of each customer. The function accepts customer number, name, quantity and price. Thereafter, it displays the message ‘Quantity less than 10..... Cannot SAVE’, if quantity entered is less than 10. Otherwise the function calculates amount as price * quantity and then writes the record in the form of a list into the binary file. import pickle def write bin(): @ bin_file= #Statement 1 while True: c_no=int (input ("enter customer number") ) c_name=input ("enter customer name") qty=int (input ("enter qty")) price-int (input ("enter price") ) if Statement 2 print ("Quantity less han 10..Cann SAVE") e price + qty c_detai no, c_name, qty, pri #statement 3 ans=input ("Do you wish to enter more records y/n") i slower ( n'y #Statement 4 #Statement 5 4#Statement 6 Write the correct statement to open a file "Cust_file.dat' for writing the data of the customer. Gi) Which statement should Shreyas fill in Statement 2 to check whether quantity is less than 10. (iii) Which statement should Shreyas fill in Statement 3 to write data to the binary file and in Statement 4 to stop further processing if the user does not wish to enter more records. OR (Option for part (iii) only) (ii) What should Shreyas fill in Statement 5 to close the binary file named Cust_file.dat and in Statement 6 to call a function to write data in binary file ? <>» EO
You might also like
Computer Science Question Paper SET-4
PDF
No ratings yet
Computer Science Question Paper SET-4
16 pages
Python Programming Exam Questions
PDF
No ratings yet
Python Programming Exam Questions
14 pages
CBSE 2023 Computer Science Paper
PDF
No ratings yet
CBSE 2023 Computer Science Paper
12 pages
Computer Science Exam Question Paper
PDF
No ratings yet
Computer Science Exam Question Paper
16 pages
821080504
PDF
No ratings yet
821080504
14 pages
12 Cs Board Paper 2022-23
PDF
No ratings yet
12 Cs Board Paper 2022-23
14 pages
Cbse Class 12 Computer Science Question Paper 2023
PDF
No ratings yet
Cbse Class 12 Computer Science Question Paper 2023
15 pages
CS 083 2022-2023 Solved
PDF
No ratings yet
CS 083 2022-2023 Solved
16 pages
QP 2023
PDF
No ratings yet
QP 2023
15 pages
Class XII Computer Science Theory Paper 2023-24
PDF
No ratings yet
Class XII Computer Science Theory Paper 2023-24
10 pages
Python Programming Concepts Explained
PDF
No ratings yet
Python Programming Concepts Explained
48 pages
Class XII Computer Science Exam Paper
PDF
No ratings yet
Class XII Computer Science Exam Paper
10 pages
Class 12 Computer Science Sample Paper
PDF
No ratings yet
Class 12 Computer Science Sample Paper
7 pages
Class XII A1 Computer Science Exam 2025-26
PDF
No ratings yet
Class XII A1 Computer Science Exam 2025-26
8 pages
Class 12 Computer Science Revision Sheet
PDF
No ratings yet
Class 12 Computer Science Revision Sheet
8 pages
Python Functions for Sports Records Management
PDF
No ratings yet
Python Functions for Sports Records Management
12 pages
Computer Science Sample Paper 05
PDF
No ratings yet
Computer Science Sample Paper 05
8 pages
Class XII Computer Science Pre-Board 2024-25
PDF
No ratings yet
Class XII Computer Science Pre-Board 2024-25
10 pages
Python Programming Exam for Class XII
PDF
No ratings yet
Python Programming Exam for Class XII
11 pages
Class XII Computer Science Pre-board Exam
PDF
No ratings yet
Class XII Computer Science Pre-board Exam
10 pages
DAV Bandhabahal Class XII CS Paper
PDF
No ratings yet
DAV Bandhabahal Class XII CS Paper
12 pages
Class 12 Computer Science Practice Paper
PDF
0% (1)
Class 12 Computer Science Practice Paper
7 pages
2023 Computer Science Exam Paper
PDF
No ratings yet
2023 Computer Science Exam Paper
10 pages
Class 12 Computer Science Practice Paper
PDF
No ratings yet
Class 12 Computer Science Practice Paper
8 pages
Python Programming Exam Instructions
PDF
No ratings yet
Python Programming Exam Instructions
15 pages
Computer Science Exam Paper 2024-25
PDF
No ratings yet
Computer Science Exam Paper 2024-25
7 pages
Class XII Computer Science Revision Sheet
PDF
No ratings yet
Class XII Computer Science Revision Sheet
7 pages
CS 2023 Python Question Paper
PDF
No ratings yet
CS 2023 Python Question Paper
17 pages
Class XII Computer Science Exam Paper
PDF
No ratings yet
Class XII Computer Science Exam Paper
9 pages
Class 12 Computer Science Sample Paper
PDF
No ratings yet
Class 12 Computer Science Sample Paper
9 pages
Army Public School Computer Science Exam
PDF
No ratings yet
Army Public School Computer Science Exam
9 pages
Computer Science Pre-Board Exam XII
PDF
No ratings yet
Computer Science Pre-Board Exam XII
7 pages
CS Pyq - (XII) AnnualBoard (24-25)
PDF
No ratings yet
CS Pyq - (XII) AnnualBoard (24-25)
13 pages
Pre Board Exam II: CS Grade XII Questions
PDF
No ratings yet
Pre Board Exam II: CS Grade XII Questions
4 pages
Computer Science Preboard Exam 2023-24
PDF
No ratings yet
Computer Science Preboard Exam 2023-24
7 pages
Xii CS Ahd QP PB1
PDF
No ratings yet
Xii CS Ahd QP PB1
7 pages
Class 12 CS Question Paper 2024 Solutions
PDF
No ratings yet
Class 12 CS Question Paper 2024 Solutions
44 pages
Code Correction and Output Prediction
PDF
No ratings yet
Code Correction and Output Prediction
8 pages
CS XII Sample Paper with Python Questions
PDF
No ratings yet
CS XII Sample Paper with Python Questions
8 pages
CS Pre Board 2 Exam Class XII Session-2023-24
PDF
No ratings yet
CS Pre Board 2 Exam Class XII Session-2023-24
6 pages
Computer Science Term Evaluation 2023-24
PDF
No ratings yet
Computer Science Term Evaluation 2023-24
24 pages
Class 12 Computer Science Exam 2024
PDF
No ratings yet
Class 12 Computer Science Exam 2024
8 pages
Pre Board 2 (CS)
PDF
No ratings yet
Pre Board 2 (CS)
12 pages
Computer Science Mid-Term Exam Key 2024
PDF
No ratings yet
Computer Science Mid-Term Exam Key 2024
7 pages
Class 12 Computer Science Practice Paper
PDF
No ratings yet
Class 12 Computer Science Practice Paper
8 pages
Class XII Computer Science Pre-Board Exam
PDF
No ratings yet
Class XII Computer Science Pre-Board Exam
10 pages
Class XII Computer Science Pre-Board Exam 2025-26
PDF
No ratings yet
Class XII Computer Science Pre-Board Exam 2025-26
18 pages
Class XII Computer Science Sample Paper
PDF
No ratings yet
Class XII Computer Science Sample Paper
11 pages
Computer Science Pre-Board Exam 2022
PDF
No ratings yet
Computer Science Pre-Board Exam 2022
22 pages
Computer Science Pre-Board Exam XII
PDF
No ratings yet
Computer Science Pre-Board Exam XII
9 pages
Pre-Board Exam Paper for Computer Science
PDF
No ratings yet
Pre-Board Exam Paper for Computer Science
8 pages
Class XII Computer Science Home Test
PDF
No ratings yet
Class XII Computer Science Home Test
11 pages
Class 12 Computer Science Exam Paper
PDF
No ratings yet
Class 12 Computer Science Exam Paper
10 pages
CS Exam Practice Paper Duration 3 Hours
PDF
No ratings yet
CS Exam Practice Paper Duration 3 Hours
7 pages
Kerala Class XII Computer Science Exam 2024
PDF
No ratings yet
Kerala Class XII Computer Science Exam 2024
8 pages