0% found this document useful (0 votes)
48 views8 pages

Computer Science Xii

Comp

Uploaded by

Ayush Das
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)
48 views8 pages

Computer Science Xii

Comp

Uploaded by

Ayush Das
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/ 8
SET-1 2 JYOTIRMOY PUBLIC SCHOOL PRE-BOARD-1 EXAMINATION, 2023-24 CLASS- Xi suB- COMPUTER SC DATE- 8.12.23 FULL MARKS- 70 DURATION- 3HOURS GENERAL INSTRUCTIONS a — READ ALL THE INSTRUCTIONS MINUTELY BEFORE YOU ANSWER Please check that this question paper contains 8 pages, Please check that this question Paper contains 35 questions. All questions are compulsory. Maintain the sequence of the Question Number, Write down the correct serial number of the question before attempting it. Please check this question paper contains 35 questions. The paper is ied into 4 Sections- A, B, C, D and E. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks. Section C, consists of 5 questions (26 to 30). Each ‘question carries 3 Marks. nD, consists of 2 questions (31 to 32). Each question carries 4 Marks. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks. All programming questions are to be answered using Python Language onl SECTION A — 1 State True or False: for iin range(0,5): is a valid for loop in Python 2 How many Foreign Keys a relation can have in MySQL database Table? 1 a)One or more_ b) Zero dr more cJOnly one d) None 3 What will be thé olltput of the following python expression:? 1 a) 5 + 2*2%*3//2-10, 23.0,°b)S_ 3.5"d)4.0 4 Find the Output: 1 ("Year 2022 at All the best" ‘aa.split(2') [o}+."+a(a}+"."+al3] print(b) « alYear.0.at All the best b)Year 0.at All the best c)Year.022.t All the best 8) Year 0. at Allthe best 4) 5 Which of the following join se "ects allows from both the, satisfies? tables ac 6 Router ina network For the given dictionar option for the value of 20) the core ce d.popitem() Print(x) a) [’Price",30] :100,"Price" Pride="620 Presidency Print(pride[-2:2:-2)) 2) ndst b) ceiePO cy ceiep 4) yndsr Which of the follow! © to copy one list into another: ») newlist =oldlist.copy() 4) newlist. ‘copy(oldlist) 10 import random . name = ['8OB’, ‘sip’, “Kanan 1K] low = random.randj 1t(0,2) high random randinta Ne for x in range(high,. Biel Priaagretg =!@') Boke si @KIM@ Shustnosessose MIK@KIM@sID@ ‘ A)KIM@siD@ I in the blank: is the benefit ofthe Networking . a) File Sharing b) Easier access to Resources ) Easier Backups d) All of these . 12 hat will be the output of the following code? def Change(A): return $ -[10,11,12,30,32,34,35,38,40,2] c=Change(B) print(‘Output is'C) a) 191 b)192 ¢)190 d) 189 The python function that places the read pointer to a given location in abinary file is B CAIED..annsnesnnnee 14 Each line of a text file is terminated by a special character called a) DNS b) IP c) CSV d) EOL Which of the following method reflects the changes made in database permanently? a).done() (8) < connection >. final ).reflect()(D) .commit() 16 Which of the following aggregate functions ignore NULL values? a) COUNT b) MAX c) AVERAGE d) All of these In the following questions, A statement of Assertion (A) is fo (R). Mark the correct choice as. (A) Both A and R are true and R is the correct explanation for A. (8) Both A and R are true and Ris not correct explanation for A. (C) Ais true but Ris false (0) Ais false but Ris true. 17 Assertion (A): Leading whitespace (spaces and tabs) at the beginning of a statement is called indentation. ; Reason (R): In Python, the same level of indentation associates statements into a single 15 lowed by a statement of Reason block of code. on . ‘Assertion (A); Dictionary is an unordered collection of data values that stores the key: value 18 pair. & Reason (R): Immutable means they cannot be changed after creation. pas SECTION -B 19 Write two advantages and disadvantages of bus topology. or xpand the Yo wing terms in Computer Networking: v WiLb) pat Uae PAN 20 Ravi, a Python programmer, is working on « project in which he wants to write a function to count the number of even and odd values in the ist. He has written the following code but his code is having errors. Rewrite the correct code and underline the corrections made, nd rocoUNT aot for 3 an range ge [219280 jonodd_no=0 0,ren(2)) (pee: odd_nos=t 7 print(even_no, odd_no) 7 21 Write a python method countmax() that accepts a ist as an argument and return the count of the element that has occurred maximum number of times Z Ege for the list num =[1,2,3,1,1,2,2,3,3,3,4] the call value for print(countmax(num)) should be 4. 22 Find and write the output of the following python code: "20","50","30","40"] cNnT=3 TOTAL=0 for Cin [7,5,4,6] T=TATICNT] TOTAL=float(T)+C print (TOTAL) 23. (q) Given is a Python string declaration : quam a "Learning Python. 4s] Fan" Write the output of : print (NAME[-5:-1 (b) Write the output of the code given below : aicti={1:["Rohit",20], 2:["Siya", 901} dict2=(1:["Rahui" 95], 5: ["Rajan", 601} dicti. update (dict2) print (dict values ()) 24. . (Differentiate between IN and BETWEEN operators in SQl with ‘\ appropriate examples 7 $5, “Write the output of the python c vg acl » def update(): -ode given below: global a 26. 27. 28. else ; all=x ‘ asaeS @=17! ee print(a,end: update(S) , print(a) SECTION-C id the output: def changer(str,s): nwstr=" for xin str: if xisdigit( nwstrsnwstrés elif x.isalpha(): if xisupper(): nwstr=nwstr+x.lower() else nwstr=nwstr+x.upper() else: nwstr=nwstrs"*" return nwstr print(changer(‘Al@miGhTy2'/x')) 5 1 %miygy Write the output of the queries (i) to Gv) based on the table, GARMENT given below : TABLE : GARMENT a GCODE | TYPE PRICE | FCODE | ODR_DATE. Gi01 | EVENING GOWN | 850 FOs 2008-12-19 102 [ SLACKS 750 F02 2020-10-20 G103___ | FROCK 1000 7 | For 2021-09-09 Gi04__| TULIP SKIRT 1550___| FOr 2021-08-10 G105___| BABY TOP 1500___| Foz 2020-08-81 G106___ [FORMAL PANT 1260 [For 2019-01-06 SELECT DISTINCT (COUNT (FCODE) ) FROM GARMENT; SELECT FCODE, COUNT(*), MIN(PRICE) FROM / GARMENT GROUP BY FCODE HAVING COUNT (+) >: SELECT TYPE FROM GARMENT WHERE ODR_DATE >'2021-02-01' AND PRICE <1500; ~ Write a python function printed() that prints all the words ending with ‘ed’ from a pre-written text file “data.txt:, ° Wises 29 Eg: For the dat “My schooling d a file containing the followi ays ended long back. | SUPP: output should be ended supported Write a python function print caps() t pre-written text file “alpha.txt.” Eg: for the data file containing the following text: ‘output should be: ' uM c Write SAL queries for (i) to (ii) ing text: ; jorted my famil oR y there after."The hat prints all the upper-case alphab “India is My Country” The ets from a based on the table EMPLOYEE and DEPARTMENT given below: Table: EMPLOYEE EMPID NAME Dos DEPTID DESIG SALARY 120 | Alisha Bejanr7es Door__| Manager 75,000 33 ___| Nitin 10-0CT1977 Doz [AO 58,000 129 | Navjot pig Bons __| Supervisor 40,000 130___| Jimmy 30-Dec-1930 Dood _| Sales Rep 131___| Faiz O6-Apri964 DOL [Dep Manager | 65,000 DEPTID DEPTNAME FLOORNO D001 Personal 4 002 Admin 10 003 Production 1 D004 Sales 3 Table- DEPARTMENT {i) To display the average salary of all employees, department wise. (ii) To display name and respective department name of each employee whose salary is more than 5000. (iii) To display the name of employees whose salary not known, in alphabetical order. | Write a python function push(stack,lst), that accepts a stack and a list of names. It ‘pushes into the stack names from the list(Ist) that have lengths of exactly three characters, The function also prints the stack. SECTION-D 31 33 Write a point of difference between append (ay and write ww) modes in a text file. Write a program in Python that defines and calls the following user defined functions : ‘Add Teacher) : It accepts the values from the user and iMerts record of a teacher to a csv file “Teacher.esv’. Each jecord consists of a list with field elements as T_id, Tname ind desig to store teacher ID, teacher ‘name and designation respectively. Search Teacher) : To display the record: (designation) teachers. SECTION -E ~~ perfect Edu Services Ltd. isan educational organization. Its planning to setup its India Campus at Karnataka with its head office at Delhi, The Karnataka Campus has 4 main buildings - ADMIN, ENGINEERING, BUSINESS and MEDIA. You 2: 2 network expert have to suggest the best network related solutions for their problems raised in (i) to (v), Keeping in mind the distances between the buildings and other given parameters. Shortest distances between various buildings: wo is of all the PGT ‘Admin to Engineering 55 mt 90 mt ‘Admin to Business ‘Admin to Media 90 mt Engineering to Business 55 mt 90 mt Engineering to Media ‘Business to Media 45 mt Delhi Head office to Karnataka campus 2175 mt » 34 35. Number of computers installed at various buildings are as follows: Admin 110 Engineering 75 Business 40 Media 2 Delhi Head office 20 Zc (i) Suggest the most appropriate location of the server inside the Karnataka campus. 7 (ii) Draw the cable layout to efficiently connect various buildings within the Karnataka campus for connecting the computers, (iii) Which hardware device will you suggest to be procured by the company to be installed to protect and control the internet uses within the campus? ; (iv) Which of the following will you suggest to establish the online face to face) communication between the people in the admin office of Karnataka campus and Delhi Head office. (v) The organization is planning to link its sale counter situated in various part of the same city. Which type of network out of LAN, WAN, MAN will be formed? Write a program and incorporate the following modules using python methods: i) A python method createfile() that creates a binary file “staff.dat” and adds three records in the file. Each,record comprises of data (Staffid, name, designation, salary) ii) A python method display() that reads the binary file “staff.dat” and prints the records whose salary is greater than 5000 E oR Write a python program and incorporate the following modules: i) A python method addrec() that creates the binary file zoo.dat and adds threerecords in the file. Each record comprises of the data (animal, family, country, total) ‘A python method couritthemt) that counts the total number of animals in the zoofrom the binaryfile and return the same. ‘ABC Infotech Pvt. Ltd. needs to store, retrieve and delete the records of its employees. Develop an interface that provides front-end interaction through Python, and stores and updates records using MySQL. The operations on MySQL table "emp" involve reading, searching, updating and deleting the records of employees. {a} Program to read and fetch all the records from EMP table having salary more than 70000. (b)Program to update the records of employees by increasing salary by 1000 of all those ‘employees who are getting less than 80000.

You might also like