Q1 - Python Class Room Diary



KENDRIYA VIDYALAYA SANGATHAN, KOLKATA REGIONComputer Science (Theory) – Half Yearly Examination -2019MARKING SCHEMEQ1.Answer the following questions: a)Expand the following:GPU – Graphics Processing UnitSoC- System on a chip(? mark for writing each correct answer)1b)What are major functional components of Mobile System? Ans. Major Functional components of a mobile system are Radio Signal Management subsystem, Display Subsystem, Power management Subsystem, CPU, Memory and Storage subsystem. (2 mark for writing Correct Answer, ? mark for writing name each component )2c)1 TB = 1024 GB1 Nibble = 4 bits1 Mark for each correct fill in the blank.2d)What is the meaning of the term “Volatile Primary Memory” ? What can be done to overcome the problems of Volatility?Ans: The Term Volatile Primary Mmeory means the Memory is temporary or erasable, which is shown by RAM. As soon as power supply is off all the content of RAM is lost, that is why it is called volatile memory.To overcome this problem , the secondary storage devices like , Hard Discs, CD / DVD , Pen Drives is used.(1 mark for writing correct explanation )(1 mark for correct identification of problem with solution)1+1=2e)What do you mean by Utility Software? Describe any one of the Utilities.The software which perform the basic housekeeping functions like Maintenance of computers or scanning and removing viruses are known as utility software.For Example : Antivirus , Disk Defragmenter , Disk Backup , Disk Clean up etc. (1 mark for writing correct definition ; 1 mark for describing any one correct example)2f)What is the difference between an interpreter and a compiler?Ans: An interpreter is a language processor that converts a high level language program into machine language line by line and simultaneously executes the converted line. Also, an interpreter must always be present in the memory. A Compiler converts a program written in HLL to machine language in one go. If there are errors in the program, it gives the error list along with the line numbers. Once the errors are removed, error free object code is made available and after this compiler is no more needed in the memory.(1 marks for writing correct difference, 1/2 mark for correctly writing working of any one language processor)1Q2.Answer the following Questions: a)Convert the Following:(175)8 to decimal(AB)16 to OctalAns: (125)10(253)8(1 mark for each correct conversion)2b)Add the binary Numbers 110110 and 101110Ans : 11001001 mark for correct answer)1c)1. UTF-8 is a variable length encoding scheme whereas UTF-32 is Fixed length encoding scheme.2. ISCII : Indian Standard Code for Information Interchange, this is an 8 bit code capable of coding 256 characters. ISCII code retains all the ASCII characters and offers coding of Indian Scripts also. (1 mark for each correct answer)2Q3.Answer the following Questions: a)What do you mean by Logic Gate? Make Truth table and logic diagram/symbol of NOR Gate. (Two variables)Ans: A Gate is a basic electronic circuit which operates on one or more signals to produce an output signal.Gates are two state (digital) circuits because the input and output signals are either low voltage (0) or high voltage (1). (1 mark for definition of Logic gate; 1 mark for correctly making truth table and 1 mark for correct logic diagram/symbol.)1+2=3b)Fill the missing term:0 + X = …….. 2). 1. X = ………Ans 1) 0 + X = X 2) 1.X = X( ? marks for writing each correct answer)1c)Draw Logic circuit diagram of the following expression:R = X.(X'+Y’)(2 marks for correct logic circuit diagram)2d)State and verify De Morgan’s Law. ( 1 mark for stating the law correctly and 2 mark for proving it through Truth table / algebraic method)3e)A . (B+ C’)( 2 Marks for correct logical expression.)3Q4.Answer the following questions: a)i. What do you mean by Cloud Computing?Ans: Cloud computing describes the act of storing, managing and processing data online, as opposed to on a physical computer or network. In other words, cloud computing is the delivery of computing services such as servers, storage, databases, networking, software, analytics etc. over the Internet. (“The Cloud”)ii. Expand the term SaaS and IaaSSaaS: Software as a service IaaS: Infrastructure as a service(01 marks for correct definition of cloud computing, ? mark each for writing correct Full Form)2b)Ans: Parallel Computing: Parallel Computing refers to the simultaneous working of multiple processors to solve a computational problem. The advantages of parallel computing are :It saves on time and the cost too.It makes it easier to solve larger or complex problems. Many problems are so large and / or complex that it is impractical or impossible to solve them on a single computer, especially given limited computer memory, e.g., searching the web or mining the big databases or analyzing big data etc. It provides efficient use of underlying hardware and can utilize the resources remotely.(02 mark for correct answer, 1 mark for writing at least one advantage.)2c)What is the difference between Linker and Loader parts of a compiler ?The linker intakes the object code generated by the assembler and combines them together along with the libraries required to generate the executable module. The loader loads this final executable module to the main memory for the execution.(1 Mark for correct explanation of each part)2d).What do mean by Operating System? Write any two functions of OS.Ans : OS : This is a system software which controls , monitors and runs the hardware of a computer system and it also provides an user interface.Functions :Device Manager , Resource Manager , Process Scheduler , Memory Manager , Network Manager etc.)(1 mark for writing correct definition and 1 mark for any two correct functions)2Q5.Answer the following questions: a)List some key characteristics of Python programming Language.Ans: Characteristics of Python Programming Language:Easy to use OO languageExpressive languageInterpreted LanguageIts completenessCross Platform languageFree and Open sourceVariety of usage/ applications(01 marks for writing 02 or more characteristics, ? mark for writing 1 characteristic.1b)Identify the data type and write Mutable/Immutable against them:(10,20,30) -Tuple (Immutable)[‘a’, ’e’, ’I’, ’o’, ’u’] – List (Mutable)‘INDIA’ – String ( Immutable)570 – Integer (Immutable)2 marks for correct data type identification; 1 mark for correctly identifying Immutable data types. ? mark for each correct data type identification. 1 mark for correctly stating Immutable types; ? marks for writing 02 data types correctly. 2 +1 c)What value will be stored in “ans” variable after executing the following expressions?ans = 17//3ans = 55%4ans = 7**4ans= True – FalseAns: i. 5ii. 3iii. 2401iv. 1 (2 marks for all 4 correct answers, ? mark for each correct answer)2d)State one similarity and one difference in Tuple and String Data type. Following code snippet returns error while Execution; explain the reason.>>>a = (5,10, 15, 20)>>>a[2]= a[1] + 5>>> print(a)Ans: Part 1- Difference:String store single type of elements whereas lists can store elements belonging to different types Similarity: Both Tuple and strings are immutable.Part 2- The code will show error since Tuple is an immutable data type.(1 mark for writing any one difference, 1 mark for correct output)2e).i. [ 11,8] ii. [11, 2, 5, 8, 29, 3, 8, 11, 8] . (1 mark for each correct answer)2Q6.Answer the following questions: a)Predict the output of the following code snippet:LST = ['A','E',['I','O'],'U']ele = LST.pop(2 )print(LST)Ans: [‘A’, ‘E’, ‘U’](1 mark for writing correct answer)1b)Write Python code (Script) to accept two numbers from the user and check whether the first number is divisible with second number.Ans: x = int (input ('Enter First number'))y= int (input ('Enter Second number'))if x % y == 0: print("Divisible")else: print("Not Divisible")(2 marks for correct program) 2c)Predict the output of the following code snippet:Dict= { 'A' : 10, 'B' : 20, 'C' : 100 , 'D' :200}temp=500;for value in Dict.values( ): temp-=value temp=(-temp)print("Final",temp)Ans: 610(2 marks for correct Output)2d)Write a Python script (Program) to take an integer number from the user and test: if it is a Prime number, display “ Prime Number“ otherwise display “Not a Prime number”Ans: num=int(input('Enter a number'))lim= int(num/2) +1for i in range(2,lim): rem=num%i if rem==0: print("Not a Prime number") breakelse: print("Prime Number")(Full 3 marks for correct coding, may be differently coded by the student)(1 mark for writing applying correct condition in loop)(1 mark for applying condition and terminating the loop with break statement)3e)Convert the following while loop in for loop:X=50while X>=10 : print(X) X=X-5 Ans: for X in range(50,10,-10): print(X)1 Mark for writing correct output2. Observer the following code and output and fill in the blank with appropriate jump statement:for a in range(1,6,1): if(a==3): continue print(a,end=' ') Output : 1 2 4 5Ans : continue1 Mark for writing correct output2f)Write a program in Python that accepts Grade and salary of a user and calculates bonus on the basis of following condition: GRADEBONUSA30% of salaryB25% of salaryC20% of salaryFor all Others5% of salary (3 marks for writing correct program, 1 mark for taking correct input of operands and operator, 1 mark for correct construct of if-elif)3Q7Answer the following questions: a)Write a program which accepts a number from the user and prints the frequency of the number in the list LST, if number is not in the LST it should print “Number not available”.LST= eval(input("Enter List"))length=len(LST)element=int(input("Enter element"))c=0for i in range(0, length): if element==LST[i]: c=c+1if c==0: print("Not found")else: print(c) (3 Marks for writing correct program; 1 mark for taking correct input, 1 mark for applying correct loop ; 1 mark for writing correct conditions.)3b)Predict the output of the following code snippet:i). for a in range (15,30,5) : if a = = 20 : continue print(a) Output:1525(1 mark for writing correct output)ii). for a in range (15,30,5): if a % 20 == 0: break print(a) Output:15(1 mark for writing correct output)2c)Write code to perform the following:Dict = { 'Teena' :18, 'Riya': 12, 'Aliya': 22, 'Ravi' : 35}Add new element with key – “Rahul” and age 40 Remove Entry of ‘Riya’:12To remove all items from the dictionary Dict.Ans:Dict['Rahul']=20del Dict['Riya']Dict.clear()(1 mark for writing each correct Answer )3Q8Answer the following questions: a)What do you mean by Exception? How it is different from Error?Ans: Exception in general refers to some contradictory or unusual situation which can be encountered unexpectedly while executing a program.Error is a bug in the program code that causes irregular output or stops a program from executing whereas an exception is an irregular unexpected situation occurring during execution on which programmer has no control. (1 mark for correct definition of Exception. 1 mark for justified point of difference)2b)What will be the output of the following program? Justify your answer.x, y, a = 5,0, Noneprint('a')try: print('b') a = x / y print('c')except: print('d') print('e') print(a) Output:abdeNoneJustification: ZeroDivisionError , except block will be executed after encountering this , so the line falling below exception will not get executed.(1 mark for correct output and 1 mark for correct justification)2 ................
................

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

Google Online Preview   Download