Vravalstudymaterialcs.files.wordpress.com



PRE BOARD EXAMINATION CHANDIGARH REGION –(2019-20)CLASS : XIISUBJECT: COMPUTER SCIENCE (083)TIME: 3 HRS MM:70General Instructions:All questions are compulsory. Extra15 minutesmust be given to student to read the question paper other than allotted3 hrs. Question paper is divided into 4 sections A, B, C and D.Section A : Unit-1Section B : Unit-2Section C: Unit-3Section D: Unit-4SECTION-A1aWhich of the following can be used as valid variable identifier(s) in Python? (i) 4thSum (ii) Total (iii) Number# (iv) _DataAns: Valid variable identifier: Total, _Data(? mark for each correct/valid identifier)1bWhich of the following are valid operators in Python:(i) */ (ii) is (iii) ^ (iv) like Ans: Valid operators: (ii) is (iii) ^(? mark for each correct/valid operator)1cName the Python Library modules which need to be imported to invoke the following functions:ceil() (ii) randrange()Ans: (i) math (ii) random(?mark for each module)1dRewrite the following code in python after removing all syntax error(s). Underline each correction done in the code.25=Valfor I in the range(0,Val) if I%2==0: print I+1 Else: print I-1Ans:CORRECTED CODEVal = 25#Error 1for I in range(0,Val):#Error 2 if I%2=0: # Error 3 print(I+1)else:#Error 4 print(I-1)(? mark for each correction)2eFind and write the output of the following pythoncode:-Text1="AISSCE 2018"Text2=""for I in range(0,len(Text1)): if Text1[I]>="0" and Text1[I]<="9": Val = int(Text1[I])+1 Text2=Text2 + str(Val)elif Text1[I]>="A" and Text1[I] <="Z": Text2=Text2 + (Text1[I+1]) else: Text2=Text2 + "*"print(Text2)Ans:Ouput: ISSCE *3129(2 marks for correct output)Note: Partial marking can also be given2fFind and write the output of the following python code:def modify(P ,Q=30): P=P+Q Q=P-Q print( P,"#",Q) return (P)R=100S=150R=modify(R,S)print(R,"#",S)S=modify(S)Ans: Output:250 # 100250 # 150180 # 150(3 marks for correct output)Note: Partial marking can also be given(1 marks for each correct output line)3gWhatpossibleoutputs(s)areexpectedtobedisplayedafter the execution of the program from the following code? Also specify the minimum values that can be assigned to thevariables FROM and TO.import randomstart=3VAL=[15,25,35,45,55,65,75,85];From=random.randint(1,3)To =random.randint(start,4)for I in range(From,To+1): print(VAL[I],"*", end=' ')35 * 45 * 55 * 65 * 75 * (ii) 35 * 45 * 55 *(iii) 15 * 25 * 35 * 45 * (iv) 35 * 45 * 55 * 65 *Ans: (ii) 35 * 45 * 55 *Minimum value for From:1Minimum value for To: 3(1 marks for correct option, ? marks for each minimum value- From, To)22aWrite one difference between list and tuple?Answer: Tuple is immutable whereas List is mutable. Tuple can’t shrink or grow whereas List can shrink or grow.(1 mark for correct difference. or ? mark for partial correct answer)1bWrite the command/statement in Python to find the length of the list?L = [1, 23, "hi" ,6]Ans: print(len(L))(1 marks for correct answer)1cWhich of the following statements create a dictionary?a) d = {}b) d = {“john”:40, “peter”:45}c) d = {40:”john”, 45:”peter”}d) All of the mentioned aboveAns: D (1 mark for correct answer)1dFind and write the output of the following python code:for x in range(10,20): if(x%2==0): continue print(x)Ans: 19(1 marks for correct answer)1eFind and write the output of the following python code: a=10def call(): global a a=15 b=20 print(a)call()Ans: 15(1 marks for correct answer)1fWhat is Python Module? What is its significance?(1 marks for correct definition of module and 1 marks for significance)2gWrite Python code to create pie chart for the followings:-Cont=[23.4,17.8, 25.35, 40]Zones=[‘East’, ‘West’, ‘North’,’South’]Show North Zone’s value explodedShow % contribution for each Zoneupto 2 precision.Ans:import matplotlib.pyplot as pltcon=[23.4,17.8, 25.35, 40]Zones=["East", "West", "North","South"]plt.pie(con, labels=Zones, explode=[0,0,0.2,0], autopct='%1.2f%%')plt.show()(2 marks for correct coding, Partial mark may be given)ORGive the output from the given python code:import matplotlib.pyplot as pltimport numpy as npmarks=[10,20,70,65,75]subject=["ENG", "HINDI", "PHY", "CHEM", "CS"]plt.bar(subject,marks, color='b', width=0.8)plt.title("BAR CHART")plt.xlabel("Subjects")plt.ylabel("Marks")plt.show()Output:(1 mark for correct labels& title and 1 mark for bars)2RWrite a function in python to read the text file ‘CITY.TXT’ and count the number of times “my” occurs in the file.ORWrite a function in python to count the number of lines in a text file ‘COUNTRY.TXT’which is starting with an alphabet ‘p’ or ‘k’.def COUNTMY():file=open('CITY.TXT','r') count=0x = file.readlines() word=x.split()for w in word:if (w==”my”):count=count+1print(“Total lines “,count) file.close()(? Mark for opening the file)(? Mark for reading all lines, and using loop) (? Mark for checking condition)(? Mark for printing lines)ORdef COUNTLINES():file=open('COUNTRY.TXT','r') lines = file.readlines() count=0for w in lines:if w[0]=="p" or w[0]=="k": count=count+1print(“Total lines “,count) file.close()(? Mark for opening the file)(? Mark for reading line and/or splitting) (? Mark for checking condition)(? Mark for printing word)2ii Write a Recursive function in python BinarySearch(Arr,l,R,X) to search the given element X to be searched from the List Arrhaving R elements,where l represents lower bound and R represents the upper bound.ORWrite a Recursive function recur_fibo(n)in python to print Fibonacci series upto n terms.defBinarySearch (Arr,l,R,X):if R >= l:mid = l + (R-l)//2 if Arr[mid] == X:return mid elifArr[mid] > X: return BinarySearch(Arr,l,mid-1,X) else: return BinarySearch(Arr,mid+1,r,X) else: return -1Arr = [ 2, 3, 4, 10, 40 ]Print(BinarySearch(Arr,0,len(Arr)-1,X)(1/2 mark for mid)(1/2 mark for return mid)(1 mark each for returning function) (1 mark for invoking function)ORdefrecur_fibo(n) if n<=1: return n else: return(recur_fibo(n-1)+ recur_fibo(n-2))nterms=int(input(“Enter n for term required”)for I in range(nterms) print(recur_fibo(i))(3 marks for correct coding)3jWrite PushOn(Book) and Pop(Book) methods/functions in Python to add a new Book and delete a Book from a List of Book titles, considering them to act as push and pop operations of the Stack data structure.Ans:-defPushOn(Book): a=input("enter book title : ") Book.append(a) def Pop(Book): if (Book==[]): print "Stack empty" else: print "Deleted element:",Book.pop()( ? mark for PushOn() header)? ( ? mark for accepting a value from user)( ? mark for adding value in list)? ( ? mark for Pop() header)?( ? mark for checking empty list condition)?( ? mark for displaying “Stack empty”)? ( ? mark for displaying the value to be deleted) ( ? mark for deleting value from list)?OrWrite a function in Python, INSERTQ(Qu, item) and DELETEQ(Qu) for performing insertion and deletion operations on a Queue. Qu is the list used for implementing queue and item is the value to be inserted.def INSERTQ(Qu, item):Qu.append(item)If len(Qu)==1 front=rear=0else: rear=len(Qu)-1def DELETEQ(Qu):if (Qu?==[]): or if isEmpty(Qu):return(“Underflow”)else:item=Qu.pop(0)if (len(Qu)==0):fornt=rear=Nonereturn item( 2 marks for each insertion and deletion function)4SECTION-B3a………… is a process of changing the characteristics of the carrier wave by superimposing the message signal on a high frequency signal.Ans: Modulation(1 mark for correct answer)1b……………….. network tool is used to troubleshoot connection problem.Ans: PING(1 mark for correct answer)1cIdentify Domain Name and URL from following: : Domain Name:cbse.nic.in, URL : cbse.nic.in/Syllabus/ComputerSci (? mark for correct domain name and ? mark for URL )1dName the Protocol Used for :a. Download / Upload File b. Remote Login to computerAns: (a) FTP (b) Telnet/SSH(? mark for each for correct protocol)1eGive the full forms of the following(i) VoIP (ii) TDMA (iii) SSH (iv) SMTPVoice over Internet protocolTime division multiple access Secure Shell Simple mail transfer protocol(? mark for each for correct full forms)2fWrite two differences between router and bridge?Ans. Bridge: (i) It connects two LAN if they are using same protocol and same topology. (ii) It works on MAC address.Router: (i) It connects to network irrespective of their protocol. (ii) It works on IP Address.(1 mark for each correct difference )2gWhat is a cloud? Ans: Cloud is a combination of network, hardware services, interfaces that helps in delivering computing as a service. OrTerm Cloud refers to the collections of servers.OrCloud is a generic term used for internet.What is cloud computing?Ans: Cloud computing is an internet based new age computer technology, whereby shared resources, Software and information are provided to computers on demand anywhere. Cloud computing services are delivered through network.Usually the internet. It provides a method to access several servers worldwide. …………..…..is an example of Public cloud.Ans: Google Drive or any other correct example(1 mark for each correct answer)3hABC company is planning to set up their new offices in India with its hub at Hyderabad . As a Network advisor ,understand their requirements and suggest to them best solution. Block to Block distance (in Meters):Block FromBlockDistanceHuman ResourceConference60Human Resource Finance 60Conference Finance30Expected Number of Computer installed in each building block:BlockComputerHuman Resource145Finace35Confrence80Which block is the most suitable block to install server?Suggest the most suitable wired medium for efficiently connecting each computer installed in every block out of the following network cables:Coaxial CableEthernet CableSingle Pair Telephone Cable iii) Which of the following devices will you suggest to connect each computer in each of the above blocks? i) Gateway ii) Switch iii) Modem iv) Suggest the type of network to connect all the blocks with suitable reason.Ans: i) Human Resource Block as it has maximum no. of computers ii) Ethernet Cable iii) Switch iv) LAN (Distance between blocks are less than 100 metres.)(1 mark for each correct answer )4SECTION-C4aWhich clause is used to sort the records of a query in Ascending order?Ans: ORDER BY(1 mark for correct answer )1bWhich keyword eliminates redundant data from a query result?Ans: DISTINCT(1 mark for correct answer )1cWhich function is used to connect or establish a connection with MySQL database?Ans: connect()(1 mark for correct answer )1dDifferentiate between Degree and Cardinality.Ans: Degree : It is the total number of attributes in the table. Cardinality: It is the total number of tuples in the table (?mark for each correct definition)1eDifferentiate between Django GET and POST methodAns: GET and POST. GET and POST are the only HTTP methods to use when dealing with forms. Django's login form is returned using the POST method, in which the browser bundles up the form data, encodes it for transmission, sends it to the server, and then receives back its response.Both of these are dictionary-like objects that give you access to GET and POST data. POST data generally is submitted from an HTML <form> , while GET data can come from a <form> or the query string in the page's URL.(2 marks for correct Answer )fDifferentiate between Primary key and Candidate key.Ans: A Candidate Key can be any column or a combination of columns that can qualify as unique key in table. There can be multiple Candidate Keys in one table where as A Primary Key is a column or a combination of columns that uniquely identify a record. Only one Candidate Key can be Primary Key.(2 marks for correct difference or 1 mark for primary key and 1 mark for candidate key definition)ORDifferentiate between WHERE clause and HAVING Clause?Ans: WHERE clause is used to select particular rows that satisfy condition and applicable on individual rows whereas HAVING clause is used with the aggregate functions and applicable on group as formed by GROUP BY clause.(1 mark for each correct clause definition)2gWrite a output for SQL queries (i) to (iii), which are based on the table: TABLE: EMPLOYEEEcodeNameDeptDOBGender DesignationSalary101SunitaSales06-06-1995FManager25000102NeeruOffice05-07-1993FClerk12000103RajuPurchase05-06-1994MManager26000104NehaOffice08-08-1995FAccountant18000105NishantOffice08-10-1995MClerk10000106VinodPurchase12-12-1994MClerk10000107SunilSales08-12-1995MExecutive24000108ShrutiSales12-06-1995FAccountant22000SELECT SUM(SALARY)FROM EMPLOYEE WHERE GENDER=’F’;SELECT MAX(DOB),MIN(DOB) FROM EMPLOYEE;SELECT GENDER,COUNT(*) from EMPLOYEE GROUP BY GENDER;Ans. (i)77000Ans. (ii) MAX(DOB) MIN(DOB) 08-12-1995 05-07-1993Ans.(iii) GENDER count(*) F 4 M 4 (1 mark for each correct output)3hWrite SQL queries for (i)to(iv), whicharebasedonthetable:EMPLOYEE givenin the question4(g):To display the records of female employeesfrom table EMPLOYEE in descending order as per their name.TodisplayEcode,DobandDeptwhoseSalaryis between20000and25000.To display Name, Gender and total number of employee who have salary more than 18000 salary, designation wiseTo increase salary of all employee by 20000 whose dept is Sales.Ans: SELECT * FROM EMPLOYEE ORDER BY Name DESC WHERE Gender=’F’;SELECT Ecode, DOB, Dept FROM EMPLOYEE WHERE salary BETWEEN 20000 AND 25000;SELECT Name, Gender, COUNT(*) FROM EMPLOYEE GROUP BY Designation HAVING Salary>18000;UPDATE EMPLOYEE SET Salary=Salary+20000 where dept=”Sales”;(1 mark for each correct query)4SECTION-D5aWhat are intellectual property rights?(1 mark for correct answer)1b____________deals with the protection of an individual’s information which is implemented while using the Internet on any computer or personal device.a) Digital agony b) Digital privacyc) Digital secrecy d) Digital protectionAns: (i) Digital privacy(1 mark for correct answer)1cIdentify the type of cybercrime for the following situations:Apersoncomplaintsthathis/herdebit/creditcardissafewithhimstill some body has done shopping/ATM transaction on thiscard.Ms.Priyankadownloaded a movie which is not available for free download. Identify the type of cybercrime she has done?Ans: (i) Identity Theft (ii) Illegal Downloading(1 mark for each correct answer )2dWhat is E-waste? Write any two e-waste disposal techniques?(1 mark for definition of E-waste, ? mark for each correct technique)2eExplain any two ways in which authentication of a person can be performed?(1 mark for each correct way of authentication)2fWhat are common gender and disability issues faced while teaching and using computers?1 mark for correct gender issues 1 mark for correct disability issues 2*******END******* ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download