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

Sample Paper 7

Computer science sample paper

Uploaded by

bhartishikha22
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
112 views

Sample Paper 7

Computer science sample paper

Uploaded by

bhartishikha22
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 7
SAMPLE Sexes QUESTION PAPER 10 Computer Science Instructions Time: 3 hrs Max. Marks : 70 1. Please check this question paper contains 35 questions. 2. The paper is divided into 5 Sections A.B, C, Dand E 3.Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark. 4, Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks. 5. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks. 6 Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks. 7.Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks. 5 8 All programming questions are to be answered using Python Language only, uSection A 1. State True or False o | “The pop) method removes and displays the last element of a list.” are drawn using certain special purpose symbols. mM (a) Algorithm: (b) Pseudocode (c) Flowchart (d) Decision table 3. The output of the code will be : mM L=(6,7,8,9,10) print(t(2:20)) (a) [8, 9, 10] 0) (c) Error (d) [6.7,8,9,10) 4. The random function returns a random value between m (a) | and 10 (b) 0 and 10 (c)Oand 1 (d) Land 100 5. Given a tuple tup=(20,50,10,60,30). The statement t.append(90) returns a (a) (20,50,10,60,30,90) (b) (90) (c) Error (a) (30,90) u 6. To read three characters from a file object f, we use... a (d) LreadlinesO (a) Lread(3) (b) fread() (©) fxreadlineO Scanned with CamScanner 142 ‘© Stage i Proficiency Level Computer Science Class 1 7. To arrange a table in descending order of field Salary the clause to be used is ty (a) Order by Salary (b) Order by Salary Dese (©) Arrange by SalaryDese (@) Arrange by Salary 8. The constraint that ensures that the field does not get any NULL valu tack 1 (a) NULL (b) PRIMARY KEY (c) CHECK (d) NOT NUL 9. ‘is’ and ‘is not’ are .. . operators. a fy (a) Membership () Identity (6) Logical (a) Comparison 10. Which of the following are possible relational operations? i) (@)Join (©) Selection (©) Cartesian product (4) All of these 11. Fill in the blank : To open a text file for adding records keeping the existing records the mede should be : 0 (a) ab (xb (rm @wt 12, Raghav is trying to write an object objl = (1,2,3,4,5) on a binary file “test.dat”. Consider the following code written by him. i import pickle objl = (1,2,3,4,5) ayfile = open(“test.dat™, ‘wb") pickle, Statement 1 nyfile.close() Identify the missing code in Statement 1. (a) dump(myfile,obj1) () dump(objl, myfile) (c)write(objl.myfile) (d) load(myfile,obj1) 13. State whether the following statement is True or False : A device that connects two dissimila: networks is repeater. 14, What will the following code display? u name = “Neh type (name) (a) Invalid function (b) (c) (d) 15. Fill in the blank : Geometric arrangement of devices on the’ network is called .. a 16. Identify the device which links two homogencous packed broadcast local networks. w (a) Hub (b) Router (©) Bridge W@ leway Directions in the question numbers 17. ‘and 18, a statement of Assertion (A)is followed by a statement of Reaso” (A). Choose the correct option. 17. Assertion (A) Default parameters to a function are not compulsory but ave a good practice & specify. a Reason (R) If default parameters are specified the formal parameters will take the delsel! values, if any of the actual parameters are not passed (a) Both A and R are true and R is the correct explanation for A. (b) Both A and R are true but R is not the correct explanation for A, (c) Ais true but R is false, (d) Ais false but R is true, Scanned with CamScanner Succeed Sample Paper 10 © Stage tt Proficiency Level 143 }. Assertion (A) 5 sett, etl 7 38 Aenean (A) Python overwrites an existing file or creates a non-existing file when we open a file Oo) Reason (R) a+ mode is used only (a) Both A and R are true and R is the (b) Both A but R are true (©) Ais true but R is false. (d) A is false but R is true, for writing operations, k correct explanation for A. but R is not the correct explanation for A. aSection B 19. Identify the types of networks formed in the following cases : (a) Two friends sharing files between a distance of 1000 km. (b) A device transmitting voice to stations within a distance of 30 km. Or (a) Which transmission media is commonly used in transporting multi-channel television signals in cities? +1=2) (b) In which topology, network components are connected to the same cable? 20. Predict the output. el (a) ‘wonders’ .center(12, "*") (b) ‘wonders25”.isalnum( ) 21. Given the following code : (2) str1 = input (“Enter the string:”) final =“ for i in range(len(stri)): if C82 == 0): final = final + str1lil print("Modified string is : “, final) ‘What is the above code doing? Or Consider the following list and answer the below questions. 1= (6, 9, 8, ‘Hi’, ‘Hello’, 45, 23, ‘New") (a) 14:3 (b) 1-43 (©) 12:5 (d) ‘Wortd*in 1 22. Write few advantages of SQL. @ Or Write the output of the following queries, which are based on the table FURNITURE given below. Table : FURNITURE = HE DATEOFPURGHASE COST DISCOUNT Double Bed OSA 0 Dinning 10-MAR-2020 o_ i-2021 0 30-DEC-2016 a aaa 17-NOV-2018 12 On-JAN-2021 14 Scanned with CamScanner Computer Science c; 144 Stage li Proficiency Level lass (a) SELECT SUM(DISCOUNT) FROM FURNITURE WHERE COST>15000: (b) SELECT MAX(DATEOFPURCHASE) FROM FURNITURE; 23. Explain the types of compile-time errors. y 24. Distinguish between tuple and list. @ Or How can you add following data in empty dictionary? Keys Values A One B Two c Three D Four 25. The code given below will give an error on execution. Identify the type of the error and modi the code to handle such type of an error. x = int(input(“Enter the value of x y = int(input(“Enter the value of y z= x/y print (“The value of 2: ", 2) @ Section C 26. Consider the tables EMP and SALGRADE storing details of employees and their salaries. (1x3=3 7 ")) Table: EMP ename sab Table: SALGRADE. aaa! ben sino SSE ROS 1 a ec Do With respect to the tables given above , write commands for the following : (a) To display the average salaries of all employces who are not from Delhi, (b) To display maximum salary from the EMP table among employees whose date is a" “2014”. “ (©) To find the count of employees who are from “Delhi, 27. Write a method Filterwords() to find and display words from a length is less than 4. text file ‘NewsLettertxt’ WO i! Or . Write a method countAN() that checks the number of occurrence of “AY and *N” in a texte “Story.txt”. Scanned with CamScanner geod Sample Paper 10 © stage Proficiency Level 145 iven the following tables for a database LIBRARY (1x3=3) Write SQL commands (a) to (c) with respect to the table BOOKS TABLE: BOOKS “Book 1d_Book Name Author_Name Publishers Price Type Qty “fa01_The Tears Wifam Hopkins Fret Publ 7 Thunderbolts Anna Roberts Fist Publ My Fist C++ Brain & Brooke ep “ju02 C++ Brainworks AW. Rossaing yp ‘co0ot Fast Cook Lala Kapoor PBS CCookey—SCi (2) To show Book name, Author name and Price of books of EPB Publishers. (b) To list the names from books of Fiction type. (© To display the names and price of the books in descending order of their price. 4%, Write user defined function patterns(n) to display the following pattern for n lines , as per the number passed to the function. The number to be input in main(Q) function. (3) Example : Enter a number :6 Enter a number :7 6 7. 66 17 666 Tet 6666 1777 66666 771777 666666 777777 7777777 4. Alinear stack called status contains the following information : (3) Phone number of Employee Name of Employee Write the following methods to perform given operations on the stack status : Push_element ( ) To Push an object containing Phone number of Employee and Name of Employee into the stack. Pop element () To Pop an object from the stack and to release the memory. 'Section D 3. Consider the following table tied ‘TABLE : PATIENTS: Dateoladen Charges Sex —2an02/96 300 F eT —paena 600 F | _Garcolopy — 2on/98 300 F Gynaecology avon ‘aoe 600 M Cardon ‘sou tr # Nuclear Medicine — cords of “Cardiology” department. ) Wa remove the re (2) Write command to charges and discount (15%) for all patients, () Display a report showing Name, (©) Display names of female patients. (4) Display the detail of patients: Scanned with CamScanner 46 32. Write a function to write data into binary file marks.dat and display the records of students frozq, © stage Proficiency Level Computer Science Class 12 file marks.dat, who scored more than 95 marks. (4 The structure of marks.dat is: (rn, sname, marks] Where, rn - roll no of student sname - name of student marks - marks of student = Section E 33. G.R.K International Inc. is planning to connect its Bengaluru Office Setup with its Head Office in Delhi. The Bengaluru Office G.R.K. International Inc. is spread across an area of approx. | square kilometres consisting of 3 blocks. Human Resources, Academics and Administration, ‘You as a network expert have to suggest answers to the questions (a) to (e) raised by them. Note Keep the distances between blocks and number of computers in each block in mind, while providing them the solutions. ax Bengals Otico Setup Tran ; Detieas neous : [Reiniraton) [Reaaarnes Shortest distances between various blocks “Human Resources to adriisvatoa Huan Resources to Acadomics “Aeademics o Aarinisraion ~~ Dei Head Office to Bengaluts 2350 km Offce Setup Number of computers installed at various blocks “Block "Wambor at Computers ~ Human Resources 185 ‘Administration 20 eaderics 100 Dai Head Ofice 20 () Suggest the most suitable block in the Bengaluru Office Setup to host the server. Give # suitable reason with your suggestion, (b) Suggest the cable layout among the various blocks within the Bengaluru Olfice Setup le" connecting the blocks, (c) Suggest the placement of switeh, (4) Suggest the most suitable media to provide secure, fast and veliable de between Delhi Head Office and the Benpelura Ollce Setup. ne (©) Expand the following WAN LAN a connectivilt Scanned with CamScanner succeed Sample Paper 10 © Stage i! Proficiency Level 147 34. (2) What is equi join? eel ae (©) Consider the table Faculty whose columns’ name are wens inane: brane, ire date, Salary, Course_none ite the code to insert the following record into the above table. Sharma 2-10-2004 ‘35000 Mishra 312-2010 728000 Data Structure Or (a) Identify which of the functions given below are aggregate functions. COUNT( , LEFT(), RIGHT( , MAX(), AVGO, TRIMO (b) What is the utility of fetchall() method? Wri Ine PHnSED bao ) method? Write a code to fetch all the records of a Student table Note : Host : localhost Database : PythonDB User : root Password:arihant Table : Student 35. (a) Which file can be opened with notepad as well as MS Excel? [2+3=5) (b) ACSV file “Garment.csv" file exists containing records of different types of garments as per following structure. GarmentID Type Gender Cost Write a python program to add and search records of garments from the esv file and display using the following functions : AddGarment() Function to input details of garments and store them to the file “Garment.csv’" , if the garment type is “cotton” or “silk”. ShowGarments() To open the file " Garment.csv", display details and number of “silk” garments Or (a) What is with statement in Python? (b) A csv file “cricket.csv" exists to store data of cricketers as follows: CID CricketerName WorldRank Write a program in python to add data of more cricketers along with the ex Also display the details of cricketers as per the condition given using the funetions: AppendCricketer() To accept data of cricketers and append the! i GetCricketers() To open the file "cricket.csv" and display number of ranking is above 50. icketers whose world Scanned with CamScanner

You might also like