XII-CS PREDBOARD SET-2

SECOND PRE BOARD EXAMINATION

CLASS: XII SESSION: 2024-25

COMPUTER SCIENCE (083)

   Time : 3 Hours                                                                      Maximum Marks: 70

General Instructions:

● This question paper contains 37 questions.

● All questions are compulsory. However, internal choices have been provided in some questions. Attempt only one of the choices in such questions

● The paper is divided into 5 Sections- A, B, C, D and E.

● Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.

● Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.

● Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.

● Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.

● Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.

● All programming questions are to be answered using Python Language only.

● In case of MCQ, text of the correct answer should also be written.

Q N Section-A (21 x 1 = 21 Marks) Marks
1Which of the following is correct to retrieve any character at index ‘i’ in string ‘s’? a) s. getitem(1)             b) s[i-1] c) s. get(i-1)                  d) s(-i)1
2What will be the output of the following Python code? def add (num1, num2):              sum=num1 + num2 sum= add(20, 30) print(sum) a) None               b) Null                  c) 50           d) 01
3Which of the following sub languages of SQL is used to define the structure of the relation, deleting relations and relating schemas? a) DDL (Data Definition Language)          b) Relational Schema c) DML (Data Manipulation Language)             d) Query1
4What is default value of host? a) localhost                            b) global host                c) Host                                  d) None of these1
5Which function is used to read all the characters? a) readcharacters()                         b) read() c) readchar()                                    d) readall()1
6________command would be written in mysql to display list of tables , whereas ________command is used to  display structure of table.1
7Given : s=”peertopeernetwork” What will be the output of print(s.find(“ee”)+s.count(“e”),s[2]+s[12::-4]+s[9:-5]) (a)  1 etprne                  (b)  6 etprne                  (c)  6 etetne                  (d)  6 etetprne1
8What is full form of NIC in networking- Network Internet Card     b) New Interface card c) New Internet Card            d) Network Interface card1
9_____ command is used to remove primary key from the table in SQL.  (a) update             (b) remove         (c) alter           (d) drop  1
10Name the python library for the following functions: [a] randint()          [b] writer()1
11Fill in the blank The ………. clause with the COUNT() function counts only the unique values in an attribute. (a) UNIQUE                  (b) HAVING                  (c) DISTINCT               (d) LIKE1
12In the following code, which lines will give error? (Assume the lines are numbered starting from 1) mul=3                                               #1               value==10                                        #2     for i in range (1, 6, 1):                      #3           if (value > mul == 0):              #4                    print (“value” * mul)      #5           else:                                        #6                    print (“value” + mul)      #7 (a) 4, 5         (b) 2,4,5             (c) 4,6             (d) 2,71
13To reflect the changes made in the database permanently, you need to run <connection>. ______ method. done()    b) reflect()      c) commit()      d) final()1
14A remote control of a TV or an AC is an example of ___________ transmission.  (a) Radio Wave  (b) Microwave (c) Satellite Link (d) Infrared1
15Push() is defined to add an element in a stack and Pop() removes an element from the stack. What will be the output of the following statements:- Push(1); Pop(): Push(2) Push(3); Pop(); Push(4) Pop(); Pop(); Push(5); After the completion of all operation, the number of elements present in stack are: a) 4             b) 3             c) 1             d) 21
16Given is a Python list declaration: names=[“naina”,”naman”,”nitin”,”navya”,”nupur”] Write the output of: print (names [-1:-4:-1][1].lower(),names[-2].index(‘a’),           names[::-2][1][:3])1
17The output of the statement:- True and False and 5 or 55 will be [a] True      [b]False   [c] 5   [d] 551
18What is the output of the expression? country=’intellectual’ print(max(country.split(“e”))) [a] ‘int’        [b] ‘ll’           [c] ‘ectual’  [d] ‘ell’1
19______is a communication methodology designed to deliver both voice  and multimedia communications over Internet protocol.  (a) VoIP              (b) SMTP             (c) PPP           (d)HTTP1
Q20 and Q21 are Assertion(A) and Reason(R) based questions. Mark the correct choice as: (A) Both A and R are true and R is the correct explanation for A (B) Both A and R are true and R is not the correct explanation for A (C) A is True but R is False (D) A is False but R is True 
20Assertion (A): A stack is a LIFO structure. Reason (R) Any new element pushed into the stack always gets positioned at the index after the last existing element in the stack.1
21Assertion (A): To use a function from a particular module, we need to import the module. Reason (R): import statement can be written anywhere in the program, before using a function from that module.1
 Section-B ( 7 x 2=14 Marks) 
22Identify token type for following: :               b)abc                    c)continue            d)56.8                2
23Identify valid relational and arithmetic operators from following: **        b)! =         c)=>          d)<=            e)//            f) +=  2
24If x={1:4,2:6,3:7}   and y={4:8,1:66,8:11} is dictionary, then, i) a) print(x.update(y),  y.items()) OR print(y.pop(1), x.get(6))   ii) (a)print(y.get(4),del x[2]) OR print(x.popitems(),x.values())    2
25What possible output(s) is/are expected to be displayed on screen at the time of execution of the program from the following code? Also, specify the maximum values that can be assigned to the variables ‘Assigned’. import random A= [10,7] As = random.randrange(10)+1 for C in range(0,2,1):       R=random.randint(1,2)-1        print(A[R]+As, “@”, end= “ ”)   (a) 11@8@                                  (b)20@21@       (c) 21@20@                                (d)  8@11@2
26Rewrite the following code in python after removing all syntax error(s).Underline each correction done in the code. 800=T class=’12-b’ for i in range(0,T):          if  i%2=0:              print(‘I’*10)          else I%3:              print(i+5)2
27i) a) Define Not NULL constraint. OR b) Define primary key constraint.   ii) a) If Mr. Sumit wants to stop empty entries in column “S.NO” of student table which constraint he should use on “S. no” column. OR b) If Mr. Amit wants to stop duplicate entries in column “S.NO” of student table which constraint he should use on “S. no” column.2
28Expand the term FTP. What is the use of FTP? OR Expand the term http. What is the use of http?2
 Section-C ( 3 x 3 = 9 Marks)  
29Write a python function that reads a text file sentence.txt and display those lines which starts with ‘A’ and ends with any vowel. OR Write a python function that reads a text file notes.txt and copy 5 letter words to newnotes.txt which starts or ends with any vowel.3
30A) You have a stack named BooksStack that contains records of books. Each book record is represented as a list containing book_title, author_name, and publication_year.Write the following user-defined functions in Python to perform the specified operations on the stack BooksStack: (I) push_book(BooksStack, new_book): This function takes the stack BooksStack and a new book record new_book as arguments and pushes the new book record onto the stack. (II) pop_book(BooksStack): This function pops the topmost book record from the stack and returns it. If the stack is already empty, the function should display “Underflow”. (III) peep(BookStack): This function displays the topmost element of the stack without deleting it. If the stack is empty, the function should display ‘None’. OR B) Write a Python program to input an integer and display all its prime factors in descending order, using a stack. For example, if the input number is 2100, the output should be: 7 5 5 3 2 2 (because prime factorization of 2100 is 7x5x5x3x2x2)3
31What will be the output of the following program code:- V = 125 def Fun (Ch) :         global V         V=100         print (V, end=Ch)         V *= 2         print (V,end=Ch)         return 90 print (V) print (Fun (“@”)) V=Fun(‘*’) print(V)                       OR Find and write the output of the following Python code: def fun(s):         k= len(s)         m=””         for i in range(0,k):                 if(s[i].isupper()):                         m=m+s[i-2].lower()                 elif s[i].islower():                         m=m+s[i+1].upper()                 else:                         m=m+’&’         print(m)  fun(‘goiNG2SChooL.COM’)3
 Section-D (4 X 4 = 16 Marks) 
32Consider the table MEDICINE as given below, Table: MEDICINE MID MED_NAME SUPP_CITY STOCK DEL_DATE M01 PARACETAMOL MUMBAI 200 2023-06-15 M02 AMOXICILLIN KOLKATA 50 2023-03-21 M03 COUGH SYRUP BENGALURU 120 2023-02-10 M04 INSULIN KOLKATA 135 2023-01-25 M05 IBUPROFEN BENGALURU  236 2023-04-05 M06 SARIDON AHMEDABAD   2023-02-12 M07 VICKS ACTION MUMBAI 710 2024-08-19   Write the following queries: i-Display name of medicine delivered in month April or stock is above 50. ii- Display no of medicines for each supplier city. iii- Increment the stock of medicine by 50 for supplier city Ahmedabad. iv-Display recently delivered date of medicine.   OR Write the output of the following queries:- [i]SELECT MID, MED_NAME FROM MEDICINE WHERE STOCK  IS NULL; [ii] SELECT COUNT(DISTINCT SUPP_CITY) FROM MEDICINE; [iii] SELECT AVG(STOCK) FROM MEDICINE GROUP BY SUPP_CITY; [iv] SELECT MID, STOCK FROM MEDICINE WHERE SUPP_CITY IN(‘KOLKATA’,’MUMBAI’)4
33A csv file “book.csv” contains the data of a survey. Each record of the file contains the following data: ● bookcode ● name of book ● publisher name ● cost of book   For example, a sample record of the file may be: [1021,‘C Language’, “BPB Pub”,560]   Write the following Python functions to perform the specified operations on this file:  (I) Read all the data from the file in the form of a list and display all those records for which the cost of book is above 1000. (II) Count the number of records in the file of BPB publication.4
34Saman has been entrusted with the management of Law University Database. He needs to access some information from FACULTY and COURSES tables for a survey analysis. Help him extract the following information by writing the desired SQL queries as mentioned below. Table: FACULTY F_ID FName LName Hire_Date Salary 102 Gautam Singh 12-10-2011 52000 103 Varun Khanna 24-12-2002 63000 104 Pankaj Lodhi 18-5-2004 45000 105 Ravi Malhotra 11-9-2004 81000 106 Sapna Das 5-6-2006 74000   Table: COURSES C_ID F_ID CName Fees C21 102 Satellites 40000 C22 106 Plant anatomy 16000 C23 104 Computer Security 8000 C24 106 Human Biology 15000 C25 102 Computer Network 20000 C26 105 Visual Basic 6000   (I) To display faculty details with salary above 50000 (II) Display name and fees of faculty joined in year 2004 (III) To increase the fees by ₹1000 for courses with name other than computer (IV) Display the details of columns of the table Faculty           OR    To display the total no. of rows of the table courses.4
35A table, named STATIONERY, in ITEMDB database, has the following structure: Field Type itemNo int(4) itemName varchar(15) price float qty int(4) Write the following Python function to perform the specified operation: AddRecords(): To input details of an item and store it in the table STATIONERY. The function should then retrieve and display all records from the STATIONERY table where the Price is greater than 120 and quantity is above 50. Also display total no. of records displayed. Assume the following for Python-Database connectivity: Host: localhost, User: root, Password: Pencil4
 Section-E (2 X 5 = 10 Marks) 
36Aman is a Python programmer. He has written a code and created a with employeeid, ename and salary. The file contains 10 records. Write a function to input the data of an employee and append it in the file “employee.dat”. Write a function search (a), to search and display data of employee whose name is passed as parameter from the file “employee.dat”. Write a function copy() to copy all records from file “employee.dat” to “newemp.dat” where salary is greater than 5000.5
37MakeInIndia Corporation, an Uttarakhand based IT Training company, is planning to set up training centres in various cities in next 2 years. Their first campus is coming up in Kashipur district. At Kashipur campus, they are planning to have 3 different blocks for App development, Web designing and Movie Editing. Each block has number of computers, which are required to be connected in a network for communication, data and resource sharing. As a network consultant of this company, you have to suggest the best network related solutions for them for issues/problems raised in question nos. (i) to (v), keeping in mind the distances between various blocks/locations and other given parameters.                   i)Suggest the most appropriate block/location to house the SERVER in the Kashipur campus (out of the 3 blocks) to get the best and effective connectivity. Justify your answer. ii) Suggest the best wired medium and draw the cable layout (Block to Block) to economically connect various blocks within the Kashipur Campus. iii) Suggest the placement of the following devices with appropriate reasons: Switch / Hub b. Repeater iv) Suggest the protocol that shall be needed to provide Video Conferencing solution between Kashipur Campus and Mussoorie Campus. v)Which protocol is required to download email on network.           OR What type of network (PAN, LAN, MAN, or WAN) will be set up among the computers connected in the KASHIPUR campus?5
error: Content is protected !!
Scroll to Top