0% found this document useful (0 votes)
41 views

Grade XII Computer Science Model Question Paper

This document is a question paper for a Computer Science examination, consisting of 35 questions divided into 5 sections with varying marks. It includes instructions for candidates regarding the structure of the paper, types of questions, and specific tasks related to programming and database management. The paper covers topics such as Python programming, SQL queries, and networking concepts.

Uploaded by

Stargazer
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
0% found this document useful (0 votes)
41 views

Grade XII Computer Science Model Question Paper

This document is a question paper for a Computer Science examination, consisting of 35 questions divided into 5 sections with varying marks. It includes instructions for candidates regarding the structure of the paper, types of questions, and specific tasks related to programming and database management. The paper covers topics such as Python programming, SQL queries, and networking concepts.

Uploaded by

Stargazer
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
You are on page 1/ 15
RT ee OL yA) Set-4 QP. Code 91/S Roll No. Candidates must write the Q.P. Code Time allowed : on the title page of the answer-book. COMPUTER SCIENCE hours Maximum Marks : 70 NOTE Please check that this question paper contains 15 printed pages ay Please check that this question paper contains 35 questions. ay Q.P. 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 (iv) Please write down the serial number of the question in the answer-book before attempting it. ous 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 students will read the question paper only and will not write any answer on the answer-book during this period. 1 PTO. General Instructions : Please read the instructions carefully. + This question paper has 5 Sections : Sections A, B, C, D, E. * All questions are compulsory. However, an internal choice of approximately 30% is provided. * Section A has 18 questions carrying 1 mark each. * Section B has 7 Very Short Answer (VSA) type questions carrying 2 marks each, * Section C has 5 Short Answer (SA) type questions carrying 3 marks each. * Section D has 2 Long Answer (LA) type question carrying 4 marks. * Section E has 3 Source-based | Case-based | Passage-based questions carrying 5 marks each. SECTION A 18x1=18 1, State True or False : 1 “In Python, tuple is a mutable data type”. 2, The primary key is selected from the set of : 1 (A) composite keys (B) alternate keys (C) candidate keys (D) foreign keys 3, What will be the output of the following statement ? 1 print (6+5/4**2//5+8) (A) -14.0 (B) 14.0 c) 14 (D) -14 4, Select the correct output of the code = 1 S = "text#next" print (S.strip("t")) (A) ext#nex (B) extnex (C) text#nex (D) ext#next ous 2 5. In SQL, which command will be used to add a new record in a table ? (A) UPDATE (B) ADD (C) INSERT (D) ALTER TABLE 6 ‘Lin HTML stands for : (A) Large (B) Language (C) Long (@) Laser 7. — Identify the valid Python identifier from the following : (A) 2user (B) user@2 (©) user_2 ) user 2 8, Consider the statements given below and then choose the correct output from the given options : Game="World Cup 2023" 11) print (Game [-6 (A) cazw (B) ceo (C) puc dirow (D) Error 9. Predict the output of the following Python statements : >>>import statistics as s >>>s.mode ([10, 20, 10, 30, 10, 20, 30]) (A) 30 (B) 20 (C) 10 (D) 18.57 9S 3 PTO. 10. 11. 12. 13. ous Which of the following output will never be obtained when the given code is executed ? import random Shuffle = random. randrange (10) +1 Draw = 10*random. randrange (5) print ("Shuffle", Shuffle, end="#") print ("Draw", Draw) (A) Shuffle 1 # Draw 0 (B) Shuffle 10 # Draw 10 (C) Shuffle 10 # Draw 0 () Shuffle 11 # Draw 50 Ethernet card is also known as: (A) LIC (B) MIC (Cc) NIC (D) OIC What will be the output of the given code ? a=10 def convert (b=20): 0 c=atb print (a,c) convert (30) print(a) For the following Python statement : N= (25) What shall be the type of N? (A) _ Integer (B) String (C) Tuple ©) List 14. Mr. Ravi is creating a field that contains alphanumeric values and fixed lengths. Which MySQL data type should he choose for the same ? (A) VARCHAR (B) CHAR (©) LONG (D) NUMBER 15. Fill in the blank : The full form of WWW is 16. files are stored in a computer in a sequence of bytes. (A) Text (B) Binary «csv (D) Notepad Questions No.17 and 18 are Assertion and Reason type questions. Each question consists of two statements, namely, Assertion (A) and Reason (R). Select the most suitable option considering the Assertion and Reason. 17. Assertion (A) : Global variables are accessible in the whole program. Reason (R): Local variables are accessible only within a function or block in which it is declared. (A) Both Assertion (A) and Reason (R) are true and Reason (R) is the correct explanation of Assertion (A). (B) Both Assertion (A) and Reason (R) are true, but Reason (R) is not the correct explanation of Assertion (A). (C) Assertion (A) is true, but Reason (R) is false. (D) Assertion (A) is false, but Reason (R) is true. ous 5 PTO. 18. Assertion (A) : If numeric data are to be written to a text file, the data 19. needs to be converted into a string before writing to the file. Reason (R): — write() method takes a string as an argument and writes it (A) (B) (C) (D) (a) (b) to the text file. Both Assertion (A) and Reason (R) are true and Reason (R) is the correct explanation of Assertion (A). Both Assertion (A) and Reason (R) are true, but Reason (R) is not the correct explanation of Assertion (A). Assertion (A) is true, but Reason (R) is false. Assertion (A) is false, but Reason (R) is true. SECTION B Qa (i) Expand the following terms : 141=2 URL, XML (ii) Give one difference between HTTP and FTP. OR (i) Define the term IP address with respect to network. (i) What is the main purpose of a Router ? I41=2 20. Observe the following code carefully and rewrite it after removing all syntactical errors. Underline all the corrections made. ous def 1func(): asinput ("Enter a number")) if a>=33 print("Promoted to next class") ELSE: print ("Repeat") 21. (a) Write the definition of a method/function SearchOut (Teachers, Name) to search for TName from a list Teachers, and display the position of its presence. 2 For example : If the Teachers contain ["Ankit", "Siddharth", "Rahul", "Sangeeta", "rahul"] and TName contains "Rahul" The function should display Rahul at 2 rahul at 4 OR (b) Write the definition of a method/function Copy Prime (1st) to copy all the prime numbers from the list 1st to another list 1st_prime. 2 22. Predict the output of the following code : 2 "IND": "DEL" ,"SRI: "COL" , "CHI" : "BEI" } stri="" for i in d: trltstr(dli])+"@" tx1 print (str2) 23. (a) Write the Python statement for each of the following tasks using BUILT-IN functions/methods only : T+1=2 (i) To delete an element 10 from the list 1st. (ii) To replace the string "This" with "That" in the string str1. OR (b) A dictionary dict2 is copied into the dictionary dict1 such that the common key’s value gets updated. Write the Python commands to do the task and after that empty the dictionary dict1. 2 ous 7 PTO. 24. (a) Mr. Atharva is given a task to create a database, Admin, He has to create a table, users in the database with the following columns: 1+1=2 User_id - int User_name - varchar (20) Password - varchar (10) Help him by writing SQL queries for both tasks. OR (b) Ms. Rita is a database administrator at a school. She is working on the table, student containing the columns like Stud_id, Name, Class and Stream. She has been asked by the Principal to strike off the record of a student named Rahul with student_id as 100 from the school records and add another student who has been admitted with the following details : 1+1=2 Stud_id - 123 Name - Rajeev Class - 12 Stream - Science Help her by writing SQL queries for both tasks. 25. Predict the output of the following code : 2 def Total (Num=10): Sum=0 for C in range(1,Num+1) : af CR2t= continue Sumt=C xeturn Sum print (Total (4) ,end="$") print (Total () , sep=' ous 8 SECTION C 26, Predict the output of the Pythe s="India Growing" n = len(s) wm: for i in range (0, n) if (s[i] >= m=m+s elif (s[i] m * and mts [4-1] elif (s[i].isupper()): m + s[i].lower() else: m=m+'@! print (m) 27. SQL queries that follow. Table : Stationery Consider the table Stationery given below and write (5x3=15 on code given below : ta! and s[i] <= 'm') [i] .upper() sli] <= 'z') the output of the ITEMNO [ITEM DISTRIBUTOR Qry PRICE 401 Ball Pen 0.5 Reliable Stationers | 100 16 402 Gel Pen Premium | Classic Plastics 150 20 403 Eraser Big 210 10 404 Eraser Small 200 5 405 Sharpener Classic sic Plastics 150 8 406 Gel Pen Classic __| Classic Plastics 100 15 @ SELECT DISTRIBUTOR, SUM(QTY) FROM STATIONERY GROUP BY DISTRIBUTOR; (i) SELECT ITEMNO, ITEM FROM STATIONERY WHERE DISTRIBUTOR = "Classic Plastics" AND PRICE > 10; (ii) SELCET ITEM, QTY * PRICE AS "AMOUNT" FROM STATIONERY WHERE ITEMNO = 402; ous PTO. 28. (a) Write a method/function CouNtWoRDS() in Python to read contents from a text file DECODE.TXT, to count and return the occurrence of those words, which are having 5 or more characters. 3 OR (b) Write a method/function COUNTLINES () in Python to read lines from a text file CONTENT.TxT, and display those lines, which have @ anywhere in the line, For example : If the content of the file is : Had an amazing time at the concert last night with @MusicLoversCrew. Excited to announce the launch of our new website! G20 @ India The method/function should display Had an amazing time at the concert last night with @MusicLoversCrew G20 @ India 29, Consider the table Rent_cab, given below Table : Rent_cab Veode | VName Make Color | Charges 101 Big car Carus White | 15 102 ‘Small car Polestar Silver [10 103 |Familycar | Windspeed | Black | 20 104 Classic Studio White | 30 105 [Luxury Trona Red [9 Based on the given table, write SQL queries for the following : 3 (i) Adda primary key to a column name Veode. (ii) Increase the charges of all the cabs by 10%. (iii) Delete all the cabs whose maker name is "Carus". ous 10 30. A dictionary, d_city contains the records in the following format : {state:city} Define the following functions with the given specifications : 3 () push_city(d_city): It takes the dictionary as an argument and pushes all the cities in the stack CITY whose states are of more than. 4 characters. (ii) pep_eity(): This function pops the cities and displays "Stack empty" when there are no more cities in the stack. SECTION D 2x4=8 31. Consider the tables GAMES and PLAYERS given below : Table : GAMES GCode [GameName [Type | Number | PrizeMoney 101__| Carrom Board | Indoor _| 2 5000 102 [Badminton | Outdoor | 2 12000 103 |Table Tennis [Indoor | 4 NULL 104 __| Chess Indoor _|2 9000) 105 [Lawn Tennis | Outdoor [4 25000 Table : PLAYERS PCode | Name GCode i Nabi Ahmad i01 2 Ravi Sahai 108 3 Jatin 101 4 Nazneen 103 ite SQL queries for the following : 4 Display the game type and average number of games played in each type. (ii) Display prize money, name of the game, and name of the players from the tables Games and Players. (ii) Display the types of games without repetition. (iv) Display the name of the game and prize money of those games whose prize money is known ous "1 PTO. 32, 33. ous Mr. Mahesh is a Python Programmer working in a school. He has to maintain the records of the sports students. He has created a csv file named sports csv, to store the details. The structure of sports. csv is : [sport_id, competition, prize_won] where sport_id, is Sport id (integer) competition is competition name (string) prize_won is (“Gold”, “Silver”, Bronze”) Mr. Mahesh wants to write the following user-defined functions : Add_detail(): to accept the detail of a student and add to a csv file, “sports.csv". Count_Medal(): to display the name of competitions in which students have won "Gold" medal. Help him in writing the code of both the functions. 4 SECTION E Bx5=15 Logistic Technologies Ltd. is a Delhi based organization which is expanding its office set-up to Ambala, At Ambala office campus, they are planning to have 3 different blocks for HR, Accounts and Logistics related work. Each block has a number of computers, which are required to be connected to a network for communication, data and resource sharing. Ambala Office Delhi ‘Head Oftice 12 As a network consultant, you have to suggest the best network related solutions for them for issues/problems raised in (i) to (v), keeping in mind the distances between various block/locations and other given parameters, Distances between various blocks/locations : HR Block to Accounts Blocks 400 meters Accounts Block to Logistics Block. 200 meters Logistics Block to HR Block 150 meters Delhi Head Office to Ambala Office 220 Km Number of computers installed at various blocks are as follows : HR Block 70 Accounts Block 40 Logisties Block 30 (i) Suggest the most appropriate block/location to house the SERVER in the Ambala office. Justify your answer. (ii) Suggest the best wired medium to efficiently connect various blocks within the Ambala office compound (iii) Draw an ideal cable layout (Block to Block) for connecting these blocks for wired connectivity. (iv) The company wants to schedule an online conference between the managers of Delhi and Ambala offices. Which protocol will be used for effective voice communication over the Internet ? (v) Which kind of network will it be between Delhi office and Ambala office ? 5 ous 13 PTO. 34, 35. ous (a) (b) (i) (a) What is the main purpose of seek () and te11() method ? Consider a binary file, Cinema.dat containing information in the following structure : [Mno, Mname, Mtype] Write a function, search_copy(), that reads the content from the file Cinema. dat and copies all the details of the "Comedy" movie type to file named movie. dat. OR Give one difference between write() and writeline() function in text file. A Binary file, "Items. dat" has the following structure : [Icode, Description, Price] Where Icode - Item code Description - Detail of item Price - Price of item Write a function Add_data(), that takes Icode, Description and Price from the user and writes the information in the binary file "Items. dat" Define the term foreign key with respect to RDBMS. Sangeeta wants to write a program in Python to delete the record of a candidate “Raman” from the table named Placement in MySQL database, Agency: The table Placement in MySQL contains the following attribute CName - string Dept - String Place - String Salary - integer Note the following to establish connectivity between Python and MySQL : + Username - root * Password — job * Host - localhost Help Sangeeta to write the program in Python for the above mentioned task. OR 14 ous (b) Gi) Gi) Give one difference between CHAR and VARCHAR datatype in MySQL, Rahim wants to write a program in Python to insert the following record in the table named Bank Account in MySQL database, Banl * Accno — integer © Cname — string © Atype string * Amount — float Note the following to establish connectivity between Python and MySQL : * Username ~ admin * Password — root: * Host - lecalhost The values of fields Accno, Cname, Atype and Amount have to be accepted from the user. Help Rahim to write the program in Python. 15

You might also like