AllBoard Computer Science Past Paper 2021-2023 PDF

Summary

This is a computer science past paper from 2021 for secondary school, covering topics from computer science, python programming, sql and computer networks. It features short answer and case study questions.

Full Transcript

2021 – BOARD QUESTION PAPER Series /C SET~4 Code No. 91 Roll No. Candidates must write the Code on the...

2021 – BOARD QUESTION PAPER Series /C SET~4 Code No. 91 Roll No. Candidates must write the Code on the title page of the answer-book. NOTE : (i) Please check that this question paper contains 13 printed pages. (ii) Code number given on the right hand side of the question paper should be written on the title page of the answer-book by the candidate. (iii) Please check that this question paper contains 40 questions. (iii) Please write down the serial number of the question in the answer-book before attempting it. (iv) 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. COMPUTER SCIENCE (NEW) Time allowed : 3 hours Maximum Marks : 70 91 Page 1 P.T.O. General Instructions : (i) This question paper contains two parts Part A and B. Each part is compulsory. (ii) Both Part A and Part B have choices. (iii) Part A has two sections : a. Section I is short answer questions, to be answered in one word or one line. b. Section II has two case study-based questions. Each case study has 5 case-based subparts. An examinee is to attempt any 4 out of the 5 subparts. (iv) Part B is Descriptive Paper. (v) Part B has three sections : a. Section I is short answer questions of 2 marks each in which two questions have internal options. b. Section II is long answer questions of 3 marks each in which two questions have internal options. c. Section III is very long answer questions of 5 marks each in which one question has an internal option. (vi) All programming questions are to be answered using Python Language only. PART A Section I Select the most appropriate option out of the options given for each question. Attempt any 15 questions from questions no. 1 to 21. 1. Which of the following options is/are not Python Keywords ? 1 (A) False (B) Math (C) WHILE (D) break 2. Given the dictionary D={'Rno': 1, 'Name':'Suraj'} , write the output of print(D('Name')). 1 3. Identify the statement(s) from the following options which will raise TypeError exception(s) : 1 (A) print('5' * 3) (B) print( 5 * 3) (C) print('5' + 3) (D) print('5' + '3') 91 Page 2 4. Identify the valid relational operator(s) in Python from the following : 1 (A) = (B) < (C) (D) not 5. For a string S declared as S = 'PYTHON', which of the following is incorrect ? 1 (A) N=len(S) (B) T = S (C) 'T' in S (D) S = 'M' 6. Write a single line statement in Python to assign the values 'BLUE', 'GREEN', 'RED' to a tuple named Colours. 1 7. A List is declared as L = ['ONE', 'TWO', 'THREE'] What will be the output of the statement ? 1 print(max(L)) 8. Write the name of the built-in function/method of the math module which when executed upon 5.8 as parameter, would return the nearest smaller integer 5. 1 9. In context of Communication Networks, which of the following is the correct expansion for the abbreviation PAN : 1 (A) Prime Area Network (B) Post Application Network (C) Picture Application Network (D) Personal Area Network 10. In context of Cyber Crimes and Cyber Thefts, the term IPR refers to : 1 (A) Internet Protocol Rights (B) Inter Personnel Rights (C) Intellectual Property Rights (D) Individual Property Rights 11. In SQL, write the name of the aggregate function which will display the cardinality of a table. 1 12. Which of the following clauses in SQL is most appropriate to use to select matching tuples in a specific range of values ? 1 (A) IN (B) LIKE (C) BETWEEN (D) IS 91 Page 3 P.T.O. 13. Which of the following is not a valid datatype in SQL ? 1 (A) DATE (B) STRING (C) DECIMAL (D) CHAR 14. Which of the following is not a valid DML command in SQL ? 1 (A) INSERT (B) UPDATE (C) ALTER (D) DELETE 15. Which of the following wireless transmission media is best suited for MAN ? 1 (A) Microwave (B) Radio Link (C) Infrared (D) Bluetooth 16. Which of the following is/are immutable object type(s) in Python ? 1 (A) List (B) String (C) Tuple (D) Dictionary 17. What shall be the ouput for the execution of the following Python Code ? 1 Cities = ['Delhi', 'Mumbai'] Cities, Cities = Cities, Cities print(Cities) 18. Which of the following commands in SQL is used to add a new record into a table ? 1 (A) ADD (B) INSERT (C) UPDATE (D) NEW 19. Which of the following is the correct expansion of DML in context of SQL ? 1 (A) Direct Machine Language (B) Data Mixing Language (C) Distributed Machine Language (D) Data Manipulation Language 91 Page 4 20. Which of the following statements correctly explains the term Firewall in context of Computer Network Society ? 1 (A) A device that protects the computer network from catching fire. (B) A device/software that controls incoming and outgoing network traffic. (C) Using abusive language on a social network site. (D) Stea it as his/her own work. 21. Which of the following protocols allows the use of HTML on the World Wide Web ? 1 (A) HTTP (B) PPP (C) FTP (D) POP Section II Both the case study-based questions are compulsory. Attempt any 4 sub-parts from each question. Each question carries 1 mark. 22. Anmol maintains that database of Medicines for his pharmacy using SQL to store the data. The structure of the table PHARMA for the purpose is as follows : Name of the table - PHARMA The attributes of PHARMA are as follows : MID - numeric MNAME - character of size 20 PRICE - numeric UNITS - numeric EXPIRY - date Table : PHARMA MID MNAME PRICE UNITS EXPIRY M1 PARACETAMOL 12 120 2022-12-25 M2 CETRIZINE 6 125 2022-10-12 M3 METFORMIN 14 150 2022-05-23 M4 VITAMIN B-6 12 120 2022-07-01 M5 VITAMIN D3 25 150 2022-06-30 M6 TELMISARTAN 22 115 2022-02-25 (a) Write the degree and cardinality of the table PHARMA. 1 (b) Identify the attribute best suitable to be declared as a primary key. 1 91 Page 5 P.T.O. (c) Anmol has received a new medicine to be added into his stock, but for which he does not know the number of UNITS. So he decides to add the medicine without its value for UNITS. The rest of the values are as follows : MID MNAME PRICE EXPIRY M7 SUCRALFATE 17 2022-03-20 Write the SQL command which Anmol should execute to perform the required task. 1 (d) Anmol wants to change the name of the attribute UNITS to QUANTITY in the table PHARMA. Which of the following commands will he use for the purpose ? 1 (i) UPDATE (ii) DROP TABLE (iii) CREATE TABLE (iv) ALTER TABLE (e) Now Anmol wants to increase the PRICE of all medicines by 5. Which of the following commands will he use for the purpose ? 1 (i) UPDATE SET (ii) INCREASE BY (iii) ALTER TABLE (iv) INSERT INTO 23. Roshni of Class 12 is writing a program in Python for her project work to create a CSV file "Teachers.csv" Number, Name for some entries. She has written the following code. However, she is unable to figure out the correct statements in a few lines of the code, hence she has left them blank. Help her to write the statements correctly for the missing parts in the code. import _________ # Line 1 def addrec(Idno, Name): # to add record into the CSV file f=open("Teachers.csv", _________) # Line 2 Filewriter = CSV.writer(f) Filewriter.writerow([Idno,name]) f.close() def readfile(): # to read the data from CSV file f=open("Teachers.csv", ________) # Line 3 FileReader = CSV.________ (f) # Line 4 for row in FileReader: print(row) f._________ # Line 5 91 Page 6 (a) Name the module she will import in Line 1. 1 (b) In which mode will she open the file to add data into the file in Line 2 ? 1 (c) In which mode will she open the file to read the data from the file in Line 3 ? 1 (d) File in the blank in Line 4 to read the data from a CSV file. 1 (e) Fill in the blank in Line 5 to close the file. 1 PART B Section I 24. Evaluate the following Python expressions : 2 (a) 2 * 3 + 4 ** 2 5 // 2 (b) 6 < 12 and not (20 > 15) or (10 > 5) 25. (a) What are cookies in a web browser ? Write one advantage and one disadvantage of enabling cookies in a web browser. 2 OR (b) Differentiate between the terms Domain Name and URL in context of web services. Also write one example of each to illustrate the difference. 2 26. Expand the following terms in context of Computer Networks : 2 (a) PPP (b) VoIP (c) GSM (d) WLL 27. (a) Explain the use of positional parameters in a Python function with the help of a suitable example. 2 OR (b) Explain the use of a default parameter in a Python function with the help of a suitable example. 2 28. Rewrite the following code in Python after removing all syntax error(s) : 2 Underline each correction done in the code. Runs = ( 10, 5, 0, 2, 4, 3 ) for I in Runs: if I=0: print(Maiden Over) else print(Not Maiden) 91 Page 7 P.T.O. 29. What possible output(s) is/are expected to be displayed on the screen at the time of execution of the program from the following code ? Also specify the maximum and minimum value that can be assigned to the variable R when K is assigned value as 2. 2 import random Signal = [ 'Stop', 'Wait', 'Go' ] for K in range(2, 0, 1): R = randrange(K) print (Signal[R], end = ' # ') (a) Stop # Wait # Go # (b) Wait # Stop # (c) Go # Wait # (d) Go # Stop # 30. What are Tuples in a SQL Table ? Write a suitable example with a SQL Table to illustrate your answer. 2 31. For the following SQL Table named PASSENGERS in a database TRAVEL: TNO NAME START END T1 RAVI KUMAR DELHI MUMBAI T2 NISHANT JAIN DELHI KOLKATA T3 DEEPAK PRAKASH MUMBAI PUNE A cursor named Cur is created in Python for a connection of a host which contains the database TRAVEL. Write the output for the execution of the following Python statements for the above SQL Table PASSENGERS: 2 Cur.execute('USE TRAVEL') Cur.execute('SELECT * FROM PASSENGERS') Recs=Cur.fetchall() for R in Recs: print(R) 32. Write the names of any two constraints and their respective uses in SQL. 2 91 Page 8 33. Write the output for the execution of the following Python code : 2 def change(A): S=0 for i in range(len(A)//2): S+=(A[i]*2) return S B = [10,11,12,30,32,34,35,38,40,2] C = Change(B) Print('Output is',C) Section II 34. Write the definition of a function Sum3(L) in Python, which accepts a list L of integers and displays the sum of all such integers from the list L which end with the digit 3. 3 For example, if the list L is passed [ 123, 10, 13, 15, 23] then the function should display the sum of 123, 13, 23, i.e. 159 as follows : Sum of integers ending with digit 3 = 159 35. (a) Write the definition of a function ChangeGender() in Python, which reads the contents of a text file "BIOPIC.TXT" and displays the content of the file with every occurrence of the word 'he' replaced by 'she'. For example, if the content of the file "BIOPIC.TXT" is as follows : 3 Last time he went to Agra, there was too much crowd, which he did not like. So this time he decided to visit some hill station. The function should read the file content and display the output as follows : Last time she went to Agra, there was too much crowd, which she did not like. So this time she decided to visit some hill station. OR 91 Page 9 P.T.O. (b) Write the definition of a function Count_Line() in Python, which should read each line of a text file "SHIVAJI.TXT" and count total number of lines present in text file. For example, if the content of the file "SHIVAJI.TXT" is as follows : 3 Shivaji was born in the family of Bhonsle. He was devoted to his mother Jijabai. India at that time was under Muslim rule. The function should read the file content and display the output as follows : Total number of lines : 3 36. Write the outputs of the SQL queries (i) to (iii) based on the relations CUSTOMER and TRANSACTION given below : 3 Table : CUSTOMER ACNO NAME GENDER BALANCE C1 RISHABH M 15000 C2 AAKASH M 12500 C3 INDIRA F 9750 C4 TUSHAR M 14600 C5 ANKITA F 22000 Table : TRANSACTION ACNO TDATE AMOUNT TYPE C1 2020-07-21 1000 DEBIT C5 2019-12-31 1500 CREDIT C3 2020-01-01 2000 CREDIT (i) SELECT MAX(BALANCE), MIN(BALANCE)FROM CUSTOMER WHERE GENDER = 'M'; (ii) SELECT SUM(AMOUNT), TYPE FROM TRANSACTION GROUP BY TYPE; (iii) SELECT NAME, TDATE, AMOUNT FROM CUSTOMER C, TRANSACTION T WHERE C.ACNO = T.ACNO AND TYPE = 'CREDIT'; 91 Page 10 37. (a) Write the definition of a function POP_PUSH(LPop, LPush, N) in Python. The function should Pop out the last N elements of the list LPop and Push them into the list LPush. For example : 3 If the contents of the list LPop are [10, 15, 20, 30] And value of N passed is 2, then the function should create the list LPush as [30, 20] And the list LPop should now contain [10, 15] NOTE : If the value of N is more than the number of elements present in LPop, then display the message "Pop not possible". OR (b) Write a function in Python POPSTACK(L) where L is a stack implemented by a list of numbers. The function returns the value deleted from the stack. 3 Section III 38. A school library is connecting computers in its units in a LAN. The library has 3 units as shown in the diagram below : 5 The three units are providing the following services : 1. Teachers Unit : For access of the Library Books by teachers 2. Students Unit : For access of the Library Books by Students 3. Circulation Unit : For issue and return of books for teachers and students Centre to Centre distances between the 3 units are as follows : Circulation Unit to Teachers Unit 20 metres Circulation Unit to Students Unit 30 metres Teachers Unit to Students Unit 10 metres Number of computers in each of the units is as follows : Circulation Unit 15 Teachers Unit 10 Students Unit 10 91 Page 11 P.T.O. (a) Suggest the most suitable place (i.e. the Unit name) to install the server of this Library with a suitable reason. (b) Suggest an ideal layout for connecting these Units for a wired connectivity. (c) Which device will you suggest to be installed and where should it be placed to provide Internet connectivity to all the Units ? (d) Suggest the type of the most efficient and economical wired medium for connecting all the computers in the network. (e) The university is planni computer which is in his office at a distance of 50 metres. Which type of network out of LAN, MAN or WAN will be used for the network ? Justify your answer. 39. Write SQL statements for the following queries (i) to (v) based on the relations CUSTOMER and TRANSACTION given below : 5 Table : CUSTOMER ACNO NAME GENDER BALANCE C1 RISHABH M 15000 C2 AAKASH M 12500 C3 INDIRA F 9750 C4 TUSHAR M 14600 C5 ANKITA F 22000 Table : TRANSACTION ACNO TDATE AMOUNT TYPE C1 2020-07-21 1000 DEBIT C5 2019-12-31 1500 CREDIT C3 2020-01-01 2000 CREDIT (a) To display all information about the CUSTOMERs whose NAME starts with 'A'. (b) To display the NAME and BALANCE of Female CUSTOMERs (with GENDER as 'F') whose TRANSACTION Date (TDATE) is in the year 2019. (c) To display the total number of CUSTOMERs for each GENDER. (d) To display the CUSTOMER NAME and BALANCE in ascending order of GENDER. (e) To display CUSTOMER NAME and their respective INTEREST for all CUSTOMERs where INTEREST is calculated as 8% of BALANCE. 91 Page 12 40. (a) A binary file "PLANTS.dat" has structure (ID, NAME, PRICE). Write the definition of a function WRITEREC() in Python, to input data for records from the user and write them to the file PLANTS.dat. Write the definition of a function SHOWHIGH() in Python, which reads the records of PLANTS.dat and displays those records for which the PRICE is more than 500. 5 OR (b) A binary file "PATIENTS.dat" has structure (PID, NAME, DISEASE). Write the definition of a function countrec()in Python that would read contents of the file "PATIENTS.dat" and display the details of those patients who have the DISEASE as 'COVID-19'. The function should also display the total number of such patients whose DISEASE is 'COVID-19'. 5 91 Page 13 P.T.O. 2021 – BOARD QUESTION PAPER - MS Strictly Confidential: (For Internal and Restricted use only) Senior School Certificate Examination September 2021 Marking Scheme – Computer Science (NEW) (SUBJECT CODE: 083) (SERIES: 3HKP3ɓ/C , PAPER CODE – 91 , SET 4 ) General Instructions: 1. You are aware that evaluation is the most important process in the actual and correct assessment of the candidates. A small mistake in evaluation may lead to serious problems which may affect the future of the candidates, education system and the teaching profession. To avoid mistakes, it is requested that before starting evaluation, you must read and understand the spot evaluation guidelines carefully. Evaluation is a 10 -12 days mission for all of us. Hence, it is necessary that you put in your best efforts in this process. 2. Evaluation is to be done as per instructions provided in the Marking Scheme. It should not be done according to one’s own interpretation or any other consideration. Marking Scheme should be strictly adhered to and religiously followed. However, while evaluating answers which are based on the latest information or knowledge and/or are innovative, they may be assessed for their correctness otherwise and marks be awarded to them. 3. The Head-Examiner must go through the first five answer books evaluated by each evaluator on the first day, to ensure that evaluation has been carried out as per the instructions given in the Marking Scheme. The remaining answer books meant for evaluation shall be given only after ensuring that there is no significant variation in the marking of individual evaluators. 4. If a question has parts, please award marks on the right-hand side for each part. Marks awarded for different parts of the question should then be totaled up and written in the left-hand margin and encircled. 5. If a question does not have any parts, marks must be awarded in the left hand margin and encircled. 6. If a student has attempted an extra question, the answer of the question deserving more marks should be retained and the other answer scored out. 7. No marks to be deducted for the cumulative effect of an error. It should be penalized only once. 8. A full scale of marks 70 (example: 1-70) has to be used. Please do not hesitate to award full marks if the answer deserves it. 9. Every examiner has to necessarily do evaluation work for full working hours i.e. 8 hours every day and evaluate 25 answer books per day. 10. Ensure that you do not make the following common types of errors committed by the Examiner in the past:- a. Leaving the answer or part thereof unassessed in an answer book. b. Giving more marks for an answer than assigned to it. c. Wrong transfer of marks from the inside pages of the answer book to the title page. d. Wrong question wise totaling on the title page. e. Wrong totaling of marks of the two columns on the title page. f. Wrong grand total. g. Marks in words and figures not tallying. h. Wrong transfer of marks from the answer book to online award list. i. Answers marked as correct, but marks not awarded. (Ensure that the right tick mark is correctly and clearly indicated. It should merely be a line. Same is with the X for incorrect answers.) j. Half or a part of the answer marked correct and the rest as wrong, but no marks awarded. 11. While evaluating the answer books, if the answer is found to be totally incorrect, it should be marked as (X) and awarded zero (0) Marks. 12. Any unassessed portion, non-carrying over of marks to the title page, or totaling error detected by the candidate shall damage the prestige of all the personnel engaged in the evaluation work as also of the Board. Hence, in order to uphold the prestige of all concerned, it is again reiterated that the instructions be followed meticulously and judiciously. 13. The Examiners should acquaint themselves with the guidelines given in the Guidelines for spot Evaluation before starting the actual evaluation. 14. Every Examiner shall also ensure that all the answers are evaluated, marks carried over to the title page, correctly totaled and written in figures and words. [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #1/23] 15. The Board permits candidates to obtain a photocopy of the Answer Book on request in an RTI application and also separately as a part of the re-evaluation process on payment of the processing charges. Specific Instructions: 1. This question paper contains two parts- Part A and B. Each part is compulsory. 2. Both Part A and Part B have choices. 3. Part-A has 2 sections: a. Section – I is short answer questions, to be answered in one word or one line. b. Section – II has two case studies questions. Each case study has 5 case-based sub parts. An examinee is to attempt any 4 out of the 5 subparts. 4. Part - B is Descriptive Paper. 5. Part- B has three sections a. Section-I is short answer questions of 2 marks each in which two questions have internal options. b. Section-II is long answer questions of 3 marks each in which two questions have internal options. c. Section-III is very long answer questions of 5 marks each in which one question has an internal option. 6. All programming questions are to be answered using Python Language only All programming questions have to be answered with respect to Python only In Python, ignore case sensitivity for identifiers (Variable / Functions) In Python indentation is mandatory, however, the number of spaces used for indenting may vary In SQL related questions – both ways of text/character entries should be acceptable for Example: “AMAR” and ‘amar’ both are acceptable. In SQL related questions – all date entries should be acceptable for Example: ‘YYYY-MM-DD’, ‘YY-MM-DD’, ‘DD-Mon-YY’, “DD/MM/YY”, ‘DD/MM/YY’, “MM/DD/YY”, ‘MM/DD/YY’ and {MM/DD/YY} are correct. In SQL related questions – semicolon should be ignored for terminating the SQL statements In SQL related questions, ignore case sensitivity. PART - A Section I Select the most appropriate option out of the options given for each question. Attempt any 15 questions from question no 1 to 21. 1 Which of the following options is/are not Python Keywords ? 1 (A) False (B) Math (C) WHILE (D) break Ans (B) Math (C) WHILE (½ Mark for writing each correct option) [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #2/23] 2 Given the dictionary D={'Rno': 1, 'Name':'Suraj'} , write the output of 1 print(D('Name')). Ans TypeError OR Suraj (1 Mark for mentioning Error) OR (1 Mark for writing the correct output as it should have been print(D['Name']) or print(D.get('Name'))) 3 Identify the statement(s) from the following options which will raise TypeError 1 exception(s) : (A) print('5' * 3) (B) print( 5 * 3) (C) print('5' + 3) (D) print('5' + '3') Ans (C) print('5' + 3) (1 Mark for writing the correct option) 4 Identify the valid relational operator(s) in Python from the following : 1 (A) = (B) < (C) (D) not Ans (B) < (1 Mark for writing the correct option) 5 For a string S declared as S = 'PYTHON', which of the following is incorrect? 1 (A) N=len(S) (B) T = S (C) 'T' in S (D) S = 'M' Ans (D) S = 'M' (1 Mark for writing the correct option) 6 Write a single line statement in Python to assign the values 'BLUE', 'GREEN', 1 'RED' to a tuple named Colours. Ans Colours = ('BLUE', 'GREEN', 'RED') (1 Mark for writing the correct statement) 7 A List is declared as L = ['ONE', 'TWO', 'THREE' ] 1 What will be the output of the statement? print(max(L)) [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #3/23] Ans TWO (1 Mark for writing the correct output) 8 Write the name of the built-in function / method of the math module which when 1 executed upon 5.8 as parameter, would return the nearest smaller integer 5. Ans floor() OR math.floor() (1 Mark for writing the correct method name) 9 In context of Communication Networks which of the following is correct expansion for 1 the abbreviation PAN : (A) Prime Area Network (B) Post Application Network (C) Picture Application Network (D) Personal Area Network Ans (D) Personal Area Network (1 Mark for writing the correct option) 10 In context of Cyber Crimes and Cyber Thefts the term IPR refers to : 1 (A) Internet Protocol Rights (B) Inter Personnel Rights (C) Intellectual Property Rights (D) Individual Property Rights Ans (C) Intellectual Property Rights (1 Mark for writing the correct option) 11 In SQL, write the name of the aggregate function which will display the cardinality of 1 a table. Ans count(*) OR count (1 Mark for writing the correct function name) 12 Which of the following clauses in SQL is most appropriate to use to select matching 1 tuples in a specific range of values ? (A) IN (B) LIKE (C) BETWEEN (D) IS Ans (C) BETWEEN (1 Mark for writing the correct option) [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #4/23] 13 Which of the following is not a valid datatype in SQL ? 1 (A) DATE (B) STRING (C) DECIMAL (D) CHAR Ans (B) STRING (1 Mark for writing the correct option) 14 Which of the following is not a valid DML command in SQL ? 1 (A) INSERT (B) UPDATE (C) ALTER (D) DELETE Ans (C) ALTER (1 Mark for writing the correct option) 15 Which of the following wireless transmission medium is best suited for MAN ? 1 (A) Microwave (B) Radio Link (C) Infrared (D) Bluetooth Ans (A) Microwave OR (B) Radio Link (1 Mark for writing any one or both of the options) 16 Which of the following is/are immutable object types in Python ? 1 (A) List (B) String (C) Tuple (D) Dictionary Ans (B) String (C) Tuple (½ Mark for writing each correct option) 17 What shall be the output for the execution of the following Python Code ? 1 Cities = ['Delhi', 'Mumbai'] Cities, Cities = Cities, Cities print(Cities) Ans ['Mumbai', 'Delhi'] (1 Mark for writing the correct output) [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #5/23] 18 Which of the following commands in SQL is used to add a new record into a table ? 1 (A) ADD (B) INSERT (C) UPDATE (D) NEW Ans (B) INSERT (1 Mark for writing the correct option) 19 Which of the following is the correct expansion of DML in context of SQL ? 1 (A) Direct Machine Language (B) Data Mixing Language (C) Distributed Machine Language (D) Data Manipulation Language Ans (D) Data Manipulation Language (1 Mark for writing the correct option) 20 Which of the following statements correctly explains the term Firewall in context of 1 Computer Network Society ? (A) A device that protects the computer network from catching fire. (B) A device/software that controls incoming and outgoing network traffic. (C) Using abusive language on a social network site. (D) Stealing someone’s text and submitting it as his/her own work. Ans (B) A device/software that controls incoming and outgoing network traffic. (1 Mark for writing the correct option) 21 Which of the following protocols allows use of HTML on the World Wide Web 1 (A) HTTP (B) PPP (C) FTP (D) POP Ans (A) HTTP (1 Mark for writing the correct option) [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #6/23] Section II Both the Case study based questions are compulsory. Attempt any 4 sub parts from each question. Each question carries 1 mark 22 Anmol maintains that database of Medicines for his pharmacy using SQL to store the data. The structure of the table PHARMA for the purpose is as follows: Name of the table - PHARMA The attributes of PHARMA are as follows: MID - numeric MNAME – character of size 20 PRICE - numeric UNITS – numeric EXPIRY - date Table: PHARMA MID MNAME PRICE UNITS EXPIRY M1 PARACETAMOL 12 120 2022-12-25 M2 CETRIZINE 6 125 2022-10-12 M3 METFORMIN 14 150 2022-05-23 M4 VITAMIN B-6 12 120 2022-07-01 M5 VITAMIN D3 25 150 2022-06-30 M6 TELMISARTAN 22 115 2022-02-25 (a) Write the degree and cardinality of the table PHARMA. 1 Ans Degree = 5 Cardinality = 6 (½ Mark for writing correct value of Degree) (½ Mark for writing correct value of Cardinality) (b) Identify the attribute best suitable to be declared as a primary key. 1 Ans MID OR MNAME (1 Mark for identifying correct Attribute Name as Primary Key) (c) Anmol has received a new medicine to be added into his stock, but for which he does 1 not know the number of UNITS. So he decides to add the medicine without its value for UNIT. The rest of the values are as follows: MID MNAME PRICE EXPIRY M7 SUCRALFATE 17 2022-03-20 Write the SQL command which Anmol should execute to perform the required task. [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #7/23] Ans INSERT INTO PHARMA (MID, MNAME, PRICE, EXPIRY) VALUES ('M7', 'SUCRALFATE', 17,'2022-03-20'); (½ Mark for writing INSERT INTO PHARMA(MID, MNAME, PRICE, EXPIRY)) (½ Mark for writing VALUES('M7','SUCRALFATE',17,'2022-03-20')) (d) Anmol wants to change the name of the attribute UNITS to QUANTITY in the table 1 PHARMA. Which of the following commands will he use for the purpose: (i) UPDATE (ii) DROP TABLE (iii) CREATE TABLE (iv) ALTER TABLE Ans (iv) ALTER TABLE (1 Mark for writing the correct option) (e) Now Anmol wants to increase the PRICE of all medicines by 5. Which of the following 1 commands will he use for the purpose: (i) UPDATE SET (ii) INCREASE BY (iii) ALTER TABLE (iv) INSERT INTO Ans (i) UPDATE SET (1 Mark for writing the correct option) 23 Roshni of class 12 is writing a program in Python for her project work to create a csv file "Teachers.csv" which will contain information for every teacher’s Identification Number, Name for some entries. She has written the following code. However she is unable to figure out the correct statements in a few lines of the code, hence she has left them blank. Help her to write the statements correctly for the missing parts in the code. import _________ # Line 1 def addrec(Idno, Name): # to add record into the CSV file f=open("Teachers.csv", _________) # Line 2 Filewriter = CSV.writer(f) Filewriter.writerow([Idno,name]) f.close() def readfile(): # to read the data from CSV file f=open("Teachers.csv", ________) # Line 3 FileReader = CSV.________ (f) # Line 4 for row in FileReader: print(row) f._________ #Line 5 (a) Name the module she will import in Line 1. 1 [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #8/23] Ans csv as CSV OR csv (1 Mark for writing the correct module name) (b) In which mode will she open the file to add data into the file in Line 2 ? 1 Ans a OR a+ OR append (1 Mark for writing the correct file mode) (c) In which mode will she open the file to read the data from the file in Line 3 ? 1 Ans r OR r+ OR read (1 Mark for writing the correct file mode) (d) File in the blank in Line 4 to read the data from a CSV file. 1 Ans reader OR Cannot interpret question (1 Mark for writing the correct missing portion) OR (1 Mark if mentioned that the question could not be interpreted) (e) Fill in the blank in Line 5 to close the file. 1 Ans close() (1 Mark for writing the correct missing portion) PART – B Section I 24 Evaluate the following Python expressions: 2 (a) 2 * 3 + 4 ** 2 - 5 // 2 Ans 20 (1 Mark for writing the correct answer) [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #9/23] (b) 6 15) or (10 > 5) True (1 Mark for writing the correct answer) 25 What are cookies in a web browser? Write one advantage and one disadvantage of 2 enabling cookies in a web browser. Ans A cookie is a small piece of information that a server sends to a client. When we visit a Web site with cookie capabilities, its server sends certain information about the visited website to our browser, which is stored on our hard drive as a text file and is called a cookie. Advantage: When we visit the same website again, the browser recognises it and makes browsing faster. Disadvantage: The file stored as a cookie can be exploited by hackers in retrieving our browsing habits and exploit it for their unlawful practices. (1 Mark for writing the correct explanation of cookie) (½ Mark for writing any one valid/correct advantage) (½ Mark for writing any one valid/correct disadvantage) OR Differentiate between the terms Domain Name and URL in context of web services. Also write one example of each to illustrate the difference. Ans Domain Name URL (Uniform Resource Locator) Domain name is a textual form of an IP URL is the complete web address address, which is easy to remember required to find a particular web page or any page within the website. It is the unique name that identifies an Internet site. Domain name is a part of URL. Domain Names always have 2 or more For example, in the URL parts, separated by dots (or periods). “http://www.w3schools.com/html/defa ult.asp”, Example: the domain name is “w3schools.com” w3schools.com, microsoft.co.in (1 Mark for writing any one valid difference between Domain Name & URL) (½ Mark for writing the correct example of Domain Name) (½ Mark for writing the correct example of a URL) 26 Expand the following terms in context of Computer Networks: 2 (a) PPP (b) VoIP (c) GSM (d) WLL [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #10/23] Ans (a) PPP - Point-to-Point Protocol (b) VoIP - Voice over Internet Protocol (c) GSM - Global System for Mobile Communication (d) WLL - Wireless Local Loop (½ Mark for writing each correct expansion) 27 Explain the use of positional parameters in a Python function with the help of a 2 suitable example. Ans In such parameters the values in the parameters of the function call are assigned in the same sequence of the corresponding identifier(s) used in the parameter(s)/ argument(s) of the respective function’s definition (i.e. from left to right). Example: def LEqn(x,y,a): return x+a*y X1=int(input("X1:")) Y1=int(input("Y1:")) A1=int(input("A1:")) print(LEqn(X1,A1,Y1)) In the above example: value of X1 is passed to x, value of A1 is passed to y, value of Y1 is passed to a due to their corresponding positions. (2 mark for briefly explaining the concept of positional parameter with the help of a suitable example) OR (1 mark if only the definition of positional parameter is written without any suitable example) OR Explain the use of a default parameter in a Python function with the help of a suitable example. Ans Default parameter takes the default values when no argument/value is passed during the function call. Consider the following function definition and two function calls: def FUN(A,B=2): print('A=',A,'B=',B) FUN(3,5) # Output will be: A=3 B=5 FUN(3) # Output will be: A=3 B=2 In the second call, when no value was passed for B, B takes its default value. (2 mark for briefly explaining the concept of default parameter with the help of a suitable example) OR (1 mark if only the definition of default parameter is written without any suitable example) [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #11/23] 28 Rewrite the following code in Python after removing all syntax error(s). 2 Underline each correction done in the code. Runs = ( 10, 5, 0, 2, 4, 3 ) for I in Runs: if I=0: print (Maiden Over) else print(Not Maiden) Ans Corrected Code: Runs = (10, 5, 0, 2, 4, 3) for I in Runs: if I==0: # Correction 1 print('Maiden Over') # Correction 2 else : # Correction 3, 4 print('Not Maiden') # Correction 5 (½ mark each for any 4 correction) (Deduct only ½ mark if the corrections are not underlined) 29 What possible outputs(s) are expected to be displayed on screen at the time of 2 execution of the program from the following code ? Also specify the maximum and minimum value that can be assigned to the variable R when K is assigned value as 2. import random Signal = [ 'Stop', 'Wait', 'Go' ] for K in range(2, 0, -1): R = randrange(K) print (Signal[R], end = ' # ') (a) Stop # Wait # Go # (b) Wait # Stop # (c) Go # Wait # (d) Go # Stop # Ans (b) Wait # Stop # Maximum value of R = 1 Minimum value of R = 0 OR randrange() raises NameError (1 Mark for writing the correct option) (½ Mark for writing the correct Maximum value of R) (½ Mark for writing the correct Minimum value of R) OR (Full 2 Marks for mentioning Error) [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #12/23] 30 What are Tuples in a SQL Table? Write a suitable example with a SQL Table to illustrate 2 your answer. Ans A tuple in a SQL table is a row of related data which represents or describes an item (or record). It is a horizontal subset of the Table. TNO NAME START END T1 RAVI KUMAR DELHI MUMBAI T2 NISHANT JAIN DELHI KOLKATA T3 DEEPAK PRAKASH MUMBAI PUNE In the above table, we have 3 Tuples: T1, RAVI KUMAR, DELHI, MUMBAI T2, NISHANT JAIN, DELHI, KOLKATA T3, DEEPAK PRAKASH, MUMBAI, PUNE (1 Mark for writing the correct explanation for Tuple) (1 Mark for writing the correct example of Tuple) 31 For the following SQL Table named PASSENGERS in a database TRAVEL: 2 TNO NAME START END T1 RAVI KUMAR DELHI MUMBAI T2 NISHANT JAIN DELHI KOLKATA T3 DEEPAK PRAKASH MUMBAI PUNE A cursor named Cur is created in Python for a connection of a host which contains the database TRAVEL. Write the output for the execution of the following Python statements for the above SQL Table PASSENGERS: Cur.execute('USE TRAVEL') Cur.execute('SELECT * FROM PASSENGERS') Recs=Cur.fetchall() for R in Recs: print(R) Ans RAVI KUMAR NISHANT JAIN DEEPAK PRAKASH (½ mark for each line of correct output) (½ mark for displaying the 3 lines of output in different lines) 32 Write the names of any two constraints and their respective uses in SQL. 2 Ans (Any 2 from the following OR any other correct constraint name with usage) PRIMARY KEY - Uniquely identifies each row/record in a database table. UNIQUE - Ensures that all values in a column are different. NOT NULL - Ensures that a column cannot have NULL value. DEFAULT - Provides a default value for a column when none is specified. CHECK - ensures that all the values in a column satisfies certain conditions. [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #13/23] (½ Mark for writing each of the two correct constraint names) (½ Mark each for writing correct usage of the two constraints) 33 Write the output for the execution of the following Python code: 2 def change(A): S=0 for i in range(len(A)//2): S+=(A[i]*2) return S B = [10,11,12,30,32,34,35,38,40,2] C = Change(B) Print('Output is',C) Ans Output is 190 OR NameError for Change() NameError for Print() (2 Mark for writing the correct output) OR (2 Mark for mentioning Error) Section II 34 Write the definition of a function Sum3(L) in Python, which accepts a list L of 3 integers and displays the sum of all such integers from the list L which end with the digit 3. For example, if the list L is passed [ 123, 10, 13, 15, 23] Then the function should display the sum of 123, 13, 23 i.e. 159 as follows: Sum of integers ending with digit 3 = 159 Ans def Sum3(L): Sum = 0 for I in L: if I%10 == 3: Sum += I print('Sum of integers ending with digit 3 =', Sum) (½ mark for the function header) (½ mark for initialising the variable Sum (or similar)) (½ mark for the traversal loop) (½ mark for checking the unit digit 3) (½ mark for adding the correct number) (½ mark for displaying the output) [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #14/23] 35 Write the definition of a function ChangeGender() in Python , which reads the 3 contents of a text file “BIOPIC.TXT” and displays the content of the file with every occurrence of the word ‘he’ replaced by ‘she’. For example, if the content of the file “BIOPIC.TXT” is as follows: Last time he went to Agra, there was too much crowd, which he did not like. So this time he decided to visit some hill station. The function should read the file content and display the output as follows: Last time she went to Agra, there was too much crowd, which she did not like. So this time she decided to visit some hill station. Ans def ChangeGender(): f=open("BIOPIC.TXT",'r') Text=f.read() print(Text.replace(' he ',' she ')) f.close() OR def ChangeGender(): with open ('BIOPIC.TXT', 'r') as File: Lines = File.readlines() for L in Lines: Words = L.split() for W in Words: if W == 'he' : W = 'she' print(W, end = ' ') print() (1 Mark for correctly opening the text file) (1 Mark for correctly reading the file - Any method) (½ Mark for correctly search and replace the word ‘he’ with ‘she’) (½ Mark for correctly displaying the modified contents with the replacements) OR Write the definition of a function Count_Line() in Python, which should read each line of a text file "SHIVAJI.TXT" and count total number of lines present in text file. For example, if the content of the file "SHIVAJI.TXT" is as follows : Shivaji was born in the family of Bhonsle. He was devoted to his mother Jijabai. India at that time was under Muslim rule. The function should read the file content and display the output as follows : Total number of lines : 3 [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #15/23] Ans def Count_Line(): with open ('SHIVAJI.TXT', 'r') as File: Lines = File.readlines() print('Total number of lines :', len(Lines)) OR def Count_Line(): f=open("SHIVAJI.TXT",'r') Lines=f.readlines() print('Total number of lines :',len(Lines)) f.close() (1 Mark for correctly opening the text file) (1 Mark for reading all lines from the file - Any method) (1 Mark for correctly displaying the total number of lines) 36 Write the outputs of the SQL queries (i) to (iii) based on the relations CUSTOMER and 3 TRANSACTION given below: Table : CUSTOMER ACNO NAME GENDER BALANCE C1 RISHABH M 15000 C2 AAKASH M 12500 C3 INDIRA F 9750 C4 TUSHAR M 14600 C5 ANKITA F 22000 Table : TRANSACTION ACNO TDATE AMOUNT TYPE C1 2020-07-21 1000 DEBIT C5 2019-12-31 1500 CREDIT C3 2020-01-01 2000 CREDIT (i) SELECT MAX(BALANCE), MIN(BALANCE)FROM CUSTOMER WHERE GENDER = 'M'; Ans MAX(BALANCE) MIN(BALANCE) 15000 12500 (½ Mark for writing each correct value - with or without column heading) (ii) SELECT SUM(AMOUNT), TYPE FROM TRANSACTION GROUP BY TYPE; Ans SUM(AMOUNT) TYPE 3500 CREDIT 1000 DEBIT [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #16/23] (½ Mark for writing each correct line of output - with or without column heading) (iii) SELECT NAME, TDATE, AMOUNT FROM CUSTOMER C, TRANSACTION T WHERE C.ACNO = T.ACNO AND TYPE = 'CREDIT'; Ans NAME TDATE AMOUNT ANKITA 2019-12-31 1500 INDIRA 2020-01-01 2000 (½ Mark for writing each correct line of output - with or without column heading) 37 (a) Write the definition of a function POP_PUSH(LPop, LPush, N) in Python. The 3 function should Pop out the last N elements of the list LPop and Push them into the list LPush. For example: If the contents of the list LPop are [10, 15, 20, 30] And value of N passed is 2, then the function should create the list LPush as [30, 20] And the list LPop should now contain [10, 15] NOTE: If the value of N is more than the number of elements present in LPop, then display the message “Pop not possible”. Ans def POP_PUSH(LPop, LPush, N): if len(LPop)0: return L.pop() else: return None OR def POPSTACK(L): return L.pop() (1 Mark for writing the correct function header) (1 Mark for popping out the last element from the list (Any method)) (1 Mark for returning the popped element) Section - III 38 A school library is connecting computers in its units in a LAN. The library has 3 units as 5 shown in the diagram below: The three units are providing the following services: 1. Teachers Unit : For access of the Library Books by teachers 2. Students Unit : For access of the Library Books by Students 3. Circulation Unit : For issue and return of books for teachers and students Center to Center distances between the 3 units are as follows: Circulation Unit to Teachers Unit - 20 metres Circulation Unit to Students Unit - 30 metres Teachers Unit to Students Unit - 10 metres Number of computers in each of the units is as follows: Circulation Unit 15 Teachers Unit 10 Students Unit 10 (a) Suggest the most suitable place (i.e. the Unit name) to install the server of this Library with a suitable reason. [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #18/23] Ans Circulation Unit Reason: It has maximum number of computers OR any other valid reason. (½ Mark for writing the correct Unit Name) (½ Mark for writing the correct reason) (b) Suggest an ideal layout for connecting these Units for a wired connectivity. Ans OR Suggesting any other valid cable layout (1 Mark for suggesting the correct connectivity layout) (c) Which device will you suggest to be installed and where should it be placed to provide Internet connectivity to all the Units. Ans Modem OR Router Placement : Circulation Unit with the server (½ Mark for writing the correct device name) (½ Mark for writing the correct placement) (d) Suggest the type of the most efficient and economical wired medium for connecting all the computers in the network. Ans CAT-6 Cable OR CAT-5 Cable OR Ethernet Cable (1 Mark for suggesting any one efficient and economical wired medium) (e) The university is planning to connect the Library with the School Principal’s computer which is in his office at a distance of 50 metres. Which type of network out of LAN, MAN, or WAN will be used for the network? Justify your answer. Ans LAN Justification: The office is located at a distance of merely 50 metres from the Library, which is within the geographical limits of a local area network. (½ Mark for writing the correct network type) (½ Mark for writing the correct Justification) [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #19/23] 39 Write SQL statements for the following queries (i) to (v) based on the relations 5 CUSTOMER and TRANSACTION given below: Table : CUSTOMER ACNO NAME GENDER BALANCE C1 RISHABH M 15000 C2 AAKASH M 12500 C3 INDIRA F 9750 C4 TUSHAR M 14600 C5 ANKITA F 22000 Table : TRANSACTION ACNO TDATE AMOUNT TYPE C1 2020-07-21 1000 DEBIT C5 2019-12-31 1500 CREDIT C3 2020-01-01 2000 CREDIT (a) To display all information about the CUSTOMERs whose NAME starts with ‘A’. Ans SELECT * FROM CUSTOMER WHERE NAME LIKE 'A%'; (½ Mark for writing correct SELECT statement) (½ Mark for writing correct WHERE clause) (b) To display the NAME and BALANCE of Female CUSTOMERs (with GENDER as 'F') whose TRANSACTION Date (TDATE) is in the year 2019. Ans SELECT NAME, BALANCE FROM CUSTOMER C, TRANSACTION T WHERE C.ACNO=T.ACNO AND GENDER=’F’ AND TDATE LIKE '2019%'; OR SELECT NAME, BALANCE FROM CUSTOMER C, TRANSACTION T WHERE C.ACNO=T.ACNO AND GENDER=’F’ AND TDATE>='2019-01-01' AND TDATE='2019-01-01' AND TDATE500: print("ID:",record) print("Name:",record) print("Price:",record) print() except: f.close() OR import pickle def WRITEREC() : with open ('PLANTS.DAT', 'wb') as FW : while True : ID = input('Enter ID : ') NAME = input('Enter NAME : ') PRICE = input('Enter PRICE : ') pickle.dump([ID, NAME, PRICE]) More = input('More records (Y/N) ? ') if More in ['n', 'N'] : break def SHOWHIGH() : with open ('PLANTS.DAT', 'rb') as FR : CR = pickle.load(FR) for R in CR: if int(R) > 500 : print(R) (½ Mark for correctly opening the PLANTS.dat file to write/append) (½ Mark for correctly inputting data from the user) (1 Mark for correctly writing the input data as a record into the file) (½ Mark for writing correct loop to add more records till user wants ) (½ Mark for correctly opening the PLANTS.dat file to read) (1 Mark for correctly loading the the file) (½ Mark for correctly checking each record price > 500) (½ Mark for displaying the validated record) [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #22/23] OR A binary file “PATIENTS.dat” has structure (PID, NAME, DISEASE). Write the definition of a function countrec() in Python that would read contents of the file “PATIENTS.dat” and display the details of those patients who have the DISEASE as ‘COVID-19’. The function should also display the total number of such patients whose DISEASE is ‘COVID-19’. Ans import pickle def countrec(): with open ('PATIENTS.DAT', 'rb') as FR : CR = pickle.load(FR) N=0 for R in CR: if (R) == 'COVID-19' : print(R) N += 1 print('Total number of Covid-19 Patients = ', N) OR import pickle def countrec(): f = open("PATIENTS.dat","rb") N=0 try: while True: data= pickle.load(f) for record in data: if record=='COVID-19': print("PID:",record) print("NAME:",record) print("DISEASE:",record) N += 1 except: f.close() print('Total number of Covid-19 Patients = ', N) (½ mark for opening the file in correct mode ) (½ mark for initialising the Counter Identifier ) (1 mark for reading the binary file ) (1 mark for the traversal loop ) (½ mark for checking the COVID-19 condition ) (½ mark for displaying the matched records ) (½ mark for incrementing the Counter Identifier ) (½ mark for displaying the final value of the Counter Identifier ) [Sub Code: 083 Series: 3HKP3ɓ/C Paper Code:91] [Page #23/23] 2020-21– BOARD SAMPLE QUESTION PAPER Class: XII Session: 2020-21 Computer Science (083) Sample Question Paper (Theory) Maximum Marks: 70 Time Allowed: 3 hours General Instructions: 1. This question paper contains two parts A and B. Each part is compulsory. 2. Both Part A and Part B have choices. 3. Part-A has 2 sections: a. Section – I is short answer questions, to be answered in one word or one line. b. Section – II has two case studies questions. Each case study has 4 case-based sub- parts. An examinee is to attempt any 4 out of the 5 subparts. 4. Part - B is Descriptive Paper. 5. Part- B has three sections a. Section-I is short answer questions of 2 marks each in which two question have internal options. b. Section-II is long answer questions of 3 marks each in which two questions have internal options. c. Section-III is very long answer questions of 5 marks each in which one question has internal option. 6. All programming questions are to be answered using Python Language only Question Part-A Marks No. allocated Section-I Select the most appropriate option out of the options given for each question. Attempt any 15 questions from question no 1 to 21. 1 Find the invalid identifier from the following 1 a) MyName b) True c) 2ndName d) My_Name 2 Given the lists L=[1,3,6,82,5,7,11,92] , write the output of print(L[2:5]) 1 3 Write the full form of CSV. 1 4 Identify the valid arithmetic operator in Python from the following. 1 a) ? b) < c) ** d) and Page 1 of 11 5 Suppose a tuple T is declared as T = (10, 12, 43, 39), which of the following is 1 incorrect? a) print(T) b) T = -29 c) print(max(T)) d) print(len(T)) 6 Write a statement in Python to declare a dictionary whose keys are 1, 2, 3 1 and values are Monday, Tuesday and Wednesday respectively. 7 A tuple is declared as 1 T = (2,5,6,9,8) What will be the value of sum(T)? 8 Name the built-in mathematical function / method that is used to return an 1 absolute value of a number. 9 Name the protocol that is used to send emails. 1 10 Your friend Ranjana complaints that somebody has created a fake profile on 1 Facebook and defaming her character with abusive comments and pictures. Identify the type of cybercrime for these situations. 11 In SQL, name the clause that is used to display the tuples in ascending order 1 of an attribute. 12 In SQL, what is the use of IS NULL operator? 1 13 Write any one aggregate function used in SQL. 1 14 Which of the following is a DDL command? 1 a) SELECT b) ALTER c) INSERT d) UPDATE 15 Name The transmission media best suitable for connecting to hilly areas. 1 16 Identify the valid declaration of L: 1 L = [‘Mon’, ‘23’, ‘hello’, ’60.5’] Page 2 of 11 a. dictionary b. string c.tuple d. list 17 If the following code is executed, what will be the output of the following 1 code? name="ComputerSciencewithPython" print(name[3:10]) 18 In SQL, write the query to display the list of tables stored in a database. 1 19 Write the expanded form of Wi-Fi. 1 20 Which of the following types of table constraints will prevent the entry of 1 duplicate rows? a) Unique b) Distinct c) Primary Key d) NULL 21 Rearrange the following terms in increasing order of data transfer rates. 1 Gbps, Mbps, Tbps, Kbps, bps Section-II Both the Case study based questions are compulsory. Attempt any 4 sub parts from each question. Each question carries 1 mark 22 A departmental store MyStore is considering to maintain their inventory using SQL to store the data. As a database administer, Abhay has decided that : Name of the database - mystore Name of the table - STORE The attributes of STORE are as follows: ItemNo - numeric ItemName – character of size 20 Scode - numeric Quantity – numeric Page 3 of 11 Table : STORE ItemNo ItemName Scode Quantity 2005 Sharpener Classic 23 60 2003 Ball Pen 0.25 22 50 2002 Get Pen Premium 21 150 2006 Get Pen Classic 21 250 2001 Eraser Small 22 220 2004 Eraser Big 22 110 2009 Ball Pen 0.5 21 180 (a) Identify the attribute best suitable to be declared as a primary key, 1 (b) Write the degree and cardinality of the table STORE. 1 (c) Insert the following data into the attributes ItemNo, ItemName and 1 SCode respectively in the given table STORE. ItemNo = 2010, ItemName = “Note Book” and Scode = 25 (d) Abhay want to remove the table STORE from the database MyStore. 1 Which command will he use from the following: a) DELETE FROM store; b) DROP TABLE store; c) DROP DATABASE mystore; d) DELETE store FROM mystore; (e) Now Abhay wants to display the structure of the table STORE, i.e, 1 name of the attributes and their respective data types that he has used in the table. Write the query to display the same. 23 Ranjan Kumar of class 12 is writing a program to create a CSV file “user.csv” which will contain user name and password for some entries. He has written the following code. As a programmer, help him to successfully execute the given task. import _____________ # Line 1 def addCsvFile(UserName,PassWord): # to write / add data into the CSV file f=open(' user.csv','________') # Line 2 Page 4 of 11 newFileWriter = csv.writer(f) newFileWriter.writerow([UserName,PassWord]) f.close() #csv file reading code def readCsvFile(): # to read data from CSV file with open(' user.csv','r') as newFile: newFileReader = csv._________(newFile) # Line 3 for row in newFileReader: print (row,row) newFile.______________ # Line 4 addCsvFile(“Arjun”,”123@456”) addCsvFile(“Arunima”,”aru@nima”) addCsvFile(“Frieda”,”myname@FRD”) readCsvFile() #Line 5 (a) Name the module he should import in Line 1. 1 (b) In which mode, Ranjan should open the file to add data into the file 1 (c) Fill in the blank in Line 3 to read the data from a csv file. 1 (d) Fill in the blank in Line 4 to close the file. 1 (e) Write the output he will obtain while executing Line 5. 1 Part – B Section-I 24 Evaluate the following expressions: 2 a) 6 * 3 + 4**2 // 5 – 8 b) 10 > 5 and 7 > 12 or not 18 > 3 25 Differentiate between Viruses and Worms in context of networking and data 2 communication threats. OR Differentiate between Web server and web browser. Write any two popular web browsers. 26 Expand the following terms: 2 a. SMTP b. XML c. LAN d. IPR Page 5 of 11 27 Differentiate between actual parameter(s) and a formal parameter(s) with a 2 suitable example for each. OR Explain the use of global key word used in a function with the help of a suitable example. 28 Rewrite the following code in Python after removing all syntax error(s). 2 Underline each correction done in the code. Value=30 for VAL in range(0,Value) If val%4==0: print (VAL*4) Elseif val%5==0: print (VAL+3) else print(VAL+10) 29 What possible outputs(s) are expected to be displayed on screen at the time 2 of execution of the program from the following code? Also specify the maximum values that can be assigned to each of the variables Lower and Upper. import random AR=[20,30,40,50,60,70]; Lower =random.randint(1,3) Upper =random.randint(2,4) for K in range(Lower, Upper +1): print (AR[K],end=”#“) (i) 10#40#70# (ii) 30#40#50# (iii) 50#60#70# (iv) 40#50#70# 30 What do you understand by Candidate Keys in a table? Give a suitable 2 example of Candidate Keys from a table containing some meaningful data. Page 6 of 11 31 Differentiate between fetchone() and fetchall() methods with suitable 2 examples for each. 32 Write the full forms of DDL and DML. Write any two commands of DML in 2 SQL. 33 Find and write the output of the following Python code: 2 def Display(str): m="" for i in range(0,len(str)): if(str[i].isupper()): m=m+str[i].lower() elif str[i].islower(): m=m+str[i].upper() else: if i%2==0: m=m+str[i-1] else: m=m+"#" print(m) Display('[email protected]') Section- II 34 Write a function LShift(Arr,n) in Python, which accepts a list Arr of numbers 3 and n is a numeric value by which all elements of the list are shifted to left. Sample Input Data of the list Arr= [ 10,20,30,40,12,11], n=2 Output Arr = [30,40,12,11,10,20] 35 Write a function in Python that counts the number of “Me” or “My” words 3 present in a text file “STORY.TXT”. If the “STORY.TXT” contents are as follows: My first book was Me and Page 7 of 11 My Family. It gave me chance to be Known to the world. The output of the function should be: Count of Me/My in file: 4 OR Write a function AMCount() in Python, which should read each character of a text file STORY.TXT, should count and display the occurance of alphabets A and M (including small cases a and m too). Example: If the file content is as follows: Updated information As simplified by official websites. The EUCount() function should display the output as: A or a:4 M or m :2 36 Write the outputs of the SQL queries (i) to (iii) based on the relations Teacher 3 and Posting given below: Table : Teacher T_ID Name Age Department Date_of_join Salary Gender 1 Jugal 34 Computer Sc 10/01/2017 12000 M 2 Sharmila 31 History 24/03/2008 20000 F 3 Sandeep 32 Mathematics 12/12/2016 30000 M 4 Sangeeta 35 History 01/07/2015 40000 F 5 Rakesh 42 Mathematics 05/09/2007 25000 M 6 Shyam 50 History 27/06/2008 30000 M 7 Shiv Om 44 Computer Sc 25/02/2017 21000 M 8 Shalakha 33 Mathematics 31/07/2018 20000 F Page 8 of 11 Table : Posting P_ID Department Place 1 History Agra 2 Mathematics Raipur 3 Computer Science Delhi i. SELECT Department, count(*) FROM Teacher GROUP BY Department; ii. SELECT Max(Date_of_Join),Min(Date_of_Join) FROM Teacher; iii. SELECT Teacher.name,Teacher.Department, Posting.Place FROM Teachr, Posting WHERE Teacher.Department = Posting.Department AND Posting.Place=”Delhi”; 37 Write a function in Python PUSH(Arr), where Arr is a list of numbers. From 3 this list push all numbers divisible by 5 into a stack implemented by using a list. Display the stack if it has at least one element, otherwise display appropriate error message. OR Write a function in Python POP(Arr), where Arr is a stack implemented by a list of numbers. The function returns the value deleted from the stack. Section-III 38 MyPace University is setting up its academic blocks at Naya Raipur 5 and is planning to set up a network. The University has 3 academic blocks and one Human Resource Center as shown in the diagram below: Center to Center distances between various blocks/center is as follows: Page 9 of 11 Law Block to business Block 40m Law block to Technology Block 80m Law Block to HR center 105m Business Block to technology 30m Block Business Block to HR Center 35m Technology block to HR center 15m Number of computers in each of the blocks/Center is as follows: Law Block 15 Technology Block 40 HR center 115 Business Block 25 a) Suggest the most suitable place (i.e., Block/Center) to install the server of this University with a suitable reason. b) Suggest an ideal layout for connecting these blocks/centers for a wired connectivity. c) Which device will you suggest to be placed/installed in each of these blocks/centers to efficiently connect all the computers within these blocks/centers. d) Suggest the placement of a Repeater in the network with justification. e) The university is planning to connect its admission office in Delhi, which is more than 1250km from university. Which type of network out of LAN, MAN, or WAN will be formed? Justify your answer. 39 Write SQL commands for the following queries (i) to (v) based on the 5 relations Teacher and Posting given below: Table : Teacher T_ID Name Age Department Date_of_join Salary Gender Computer 1 Jugal 34 10/01/2017 12000 M Sc 2 Sharmila 31 History 24/03/2008 20000 F Page 10 of 11 3 Sandeep 32 Mathematics 12/12/2016 30000 M 4 Sangeeta 35 History 01/07/2015 40000 F 5 Rakesh 42 Mathematics 05/09/2007 25000 M 6 Shyam 50 History 27/06/2008 30000 M Computer 7 Shiv Om 44 25/02/2017 21000 M Sc 8 Shalakha 33 Mathematics 31/07/2018 20000 F Table : Posting P_ID Department Place 1 History Agra 2 Mathematics Raipur 3 Computer Science Delhi i. To show all information about the teacher of History department. ii. To list the names of female teachers who are in Mathematics department. iii. To list the names of all teachers with their date of joining in ascending order. iv. To display teacher’s name, salary, age for male teachers only. v. To display name, bonus for each teacher where bonus is 10% of salary. 40 5 A binary file “Book.dat” has structure [BookNo, Book_Name, Author, Price]. i. Write a user defined function CreateFile() to input data for a record and add to Book.dat. ii. Write a function CountRec(Author) in Python which accepts the Author name as parameter and count and return number of books by the given Author are stored in the binary file “Book.dat” OR A binary file “STUDENT.DAT” has structure (admission_number, Name, Percentage). Write a function countrec() in Python that would read contents of the file “STUDENT.DAT” and display the details of those students whose percentage is above 75. Also display number of students scoring above 75% Page 11 of 11 2020-21– BOARD SAMPLE QUESTION PAPER -MS Sample Question Paper - 2021 Computer Science – 083 MARKING SCHEME Maximum Marks: 70 Time Allowed: 3 hours Part – A Section - I 1 b) True 1 2 [6,82,5] 1 3 Comma Separated Value 1 4 c) ** 1 5 b) T= -29 (as tuple is immutable) 1 6 Day={1:'monday',2:'tuesday',3:'wednesday'} 1 7 30 8 abs() 1 9 SMTP 1 10 Cyber Stalking 1 11 ORDER BY 1 12 To check if the column has null value / no value 1 13 SUM / AVG / COUNT / MAX / MIN 1 14 b) ALTER 1 15 Microwave / Radio wave 1 16 d. List 1 17 puterSc 1 18 SHOW TABLES 1 19 Wireless Fidelity 1 20 (c) Primary Key 1 21 Bps, Kbps, Mbps, Gbps, Tbps 1 Part – A Section - II 22 (a) ItemNo 1 (b) Degree = 4 Cardinality = 7 1 (c) INSERT INTO store (ItemNo,ItemName,Scode) VALUES(2010, “Note Book”,25); 1 (d) DROP TABLE store; 1 (e) Describe Store; 1 23 (a) Line 1 : csv 1 (b) Line 2 : a 1 (c) Line 3 : reader 1 (d) Line 4 : close() 1 Page 1 of 7 (e) Line 5 : Arjun 123@456 1 Arunima aru@nima Frieda myname@FRD Part – B 24 a) 13 2 b) False 25 Viruses require an active host program or an already-infected and active operating system in 2 order for viruses to run, cause damage and infect other executable files or documents Worms are stand-alone malicious programs that can self-replicate. OR Web Browser : A web browser is a software application for accessing information on the World Wide Web. When a user requests a web page from a particular website, the web browser retrieves the necessary content from a web server and then displays the page on the user's device. Web Server : A web server is a computer that runs websites. The basic objective of the web server is to store, process and deliver web pages to the users. This intercommunication is done using Hypertext Transfer Protocol (HTTP). Popular web browsers : Google Chrome, Mozilla Firefox, Internet Explorer etc 26 a. SMTP - Simple Mail Transfer Protocol 2 b. XML - eXtensible Markup Language c. LAN – Local Area Network d. IPR – Intellectual Property Rights 27 The list of identifiers used in a function call is called actual parameter(s) whereas the list of 2 parameters used in the function definition is called formal parameter(s). Actual parameter may be value / variable or expression. Formal parameter is an identifier. Example: def area(side): # line 1 return side*side; print(area(5)) # line 2 In line 1, side is the formal parameter and in line 2, while invoking area() function, the value 5 is the actual parameter. Page 2 of 7 A formal parameter, i.e. a parameter, is in the function definition. An actual parameter, i.e. an argument, is in a function call. OR Use of global key word: In Python, global keyword allows the programmer to modify the variable outside the current scope. It is used to create a global variable and make changes to the variable in local context. A variable declared inside a function is by default local and a variable declared outside the function is global by default. The keyword global is written inside the function to use its global value. Outside the function, global keyword has no effect. Example c = 10 # global variable def add(): global c

Use Quizgecko on...
Browser
Browser