Trending ▼   ResFinder  

CBSE Class 12 Pre Board 2024 : Computer Science : PreBoard-2024

8 pages, 0 questions, 0 questions with responses, 0 total responses,    0    0
Infant vinoth
St.Anne's School, Cuddalore,  Cuddalore 
+Fave Message
 Home > balps >

Formatting page ...

Question Q.No Marks SECTION A 1 State True or False: CSV file is also known as delimited text file which can be opened in Notepad and Spreadsheet both. 1 2 Which SQL command is used to retrieve a list of all tables stored in a database? a. Get Tables; b. List Tables; c. Show Tables; d. Fetch All Tables; 1 3 Evaluate the following logical expression: True and not False or False or not True and False 1 4 ____________ function splits the given string based on delimiter and store the result in the form of list. a. partition() b. split() c. divide() d. clear() 1 5 In a table there can be more than one attribute which contains unique values. These columns are known as _______________ keys. 1 6 A device that amplifies a signal being transmitted on the network is known as: a. Modem b. Repeater c. Hub d. Switch 1 7 Write the output of the code given below: info = {"name": "Alice", "age": 25} info['age'] = 30 info['city'] = "Wonderland" print(info) Find the output of the following code: number = [1, 5, 7, 0, 4] print(number[2:3]) 1 8 a. [5] 9 b. [7] c. [7,0] 1 d. None of above Which of the following statement(s) would give an error during execution of the following code? lst = (10, 25, 30, 42, 56, 73) print(lst) # Statement 1 print(lst[2] * 2) # Statement 2 print(min(lst)) # Statement 3 lst[1] = 50 # Statement 4 a. Statement 1 b. Statement 2 c. Statement 3 1 d. Statement 4 10 The internet facility that facilitates remote login is: a. HTTP b. FTP c. TELNET d. LAN 1 11 Which of the following transmission media has the highest bandwidth? a. Co-axial cable b. Optical Fiber cable c. Twisted pair cable d. None of these What possible outputs(s) will be obtained when the following code is executed? import random 1 12 1 SELECTION = random.randint(1, 3) ANIMALS = ["LION", "TIGER", "ELEPHANT", "GIRAFFE"] for animal in ANIMALS: for i in range(0, SELECTION): print(animal, end="") print() 13 14 a. LIONTIGERLION ELEPHANTELEPHANT GIRAFFE b. LION TIGERTIGER ELEPHANT GIRAFFEGIRAFFEGIRAFFE c. LIONLIONLION TIGERTIGERTIGER ELEPHANT GIRAFFE d. ELEPHANT GIRAFFE TIGERTIGER LION Stack is a linear data structure which implements? a. Last in First out b. Last in Last out c. First in First out d. None of the above Consider the code given below: x = 50 def sample(y): ________________ x=x+y print(y, x) sample(5) print(x) 1 1 Which of the following statements should be given in the blank for #Missing Statement, if the output produced is 55? a. global y b. global x=50 c. global x d. global y=50 15 Which of the following function is used with the csv modules in Python to read the content of a csv file into an object? a. readrow() b. readrows() c. reader() d. load() 1 16 Which of the following statements is FALSE concerning SQL queries? a. The SELECT statement is used to retrieve data from one or more tables. b. The WHERE clause is used to filter records based on a specified condition. c. A JOIN combines rows from two or more tables based on a related column. d. The DELETE statement is only used to remove entire tables from the database. Q17 and 18 are ASSERTION AND REASONING 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 1 17 18 19 20 21 22 23 Assertion(A): Dictionary in Python is a mutable data type. Reasoning(R): Similar to sets, dictionaries can be modified as they are mutable. You can add, remove, or update key-value pairs in a dictionary without creating a new dictionary. Assertion(A): Every open file maintains a file-pointer and keeps track of its position after every operation. Reason (R): Every read and write operation takes place at the current position of the file pointer. SECTION - B (i) (ii) Expand the following terms: SMTP, HTML Give one difference between Packet Switching and Circuit Switching. The code given below accepts a number as an argument and returns the reverse number. Observe the following code carefully and rewrite it after removing all syntax and logical errors. Underline all the corrections made. define revNumber (num): rev = 0 rem = 0 While num > 0: rem = =num %10 rev = rev*10 + rem num = num//10 return rev print (revNumber (1234)) Write a Python function called findVowels(words) that takes a list of words as input and returns a new list containing words that start with a vowel. For instance, given the list ["apple", "banana", "orange", "kiwi", "grape"], the function should output ["apple", "orange"]. OR Create a function, reverseWords(STRING), which takes a string as input and returns a new string with the order of words reversed. For example, if the input is "OpenAI is revolutionizing AI", the output should be "AI revolutionizing is OpenAI". Predict the output of the following code: X = "HELLO" Y = [5, 10, 15, 20] Z = {} for i in range(len(X)): if i % 2 == 0: Z[Y.pop()] X[i] else: Z[Y.pop()] = 2 * 4 for key, value in Z.items(): print(key, value, sep=":") Write a Python statement using BUILT-IN functions/methods only to: (i) Remove the last element from the list my_list. (ii) Count the number of occurrences of the substring "abc" in the string my_string. 1 1 1+1=2 2 2 2 1+1=2 24 25 Mr. Chase Dominic has a table named "Inventory" with columns ItemName, Quantity, and Price. He wants to ensure that the "Price" column does not contain any NULL values. Write an SQL command to alter the table and enforce this constraint on the "Price" column. Predict the output of the following code: def Transformer(X, Y=5): X=X*Y Y=X%Y return X 2 2 A = 15 B=3 A = Transformer(A, B) print(A, B, sep='@') B = Transformer(B) print(A, B, sep='@', end='###') 26 27 SECTION - C Find and write the output of the following Python code: def Show(str): m="" for i in range(0,len(str)): if(str[i].isupper()): m=m+str[i].lower() elif str[i].islower(): m=m+str[i].upper() else: if i%2==0: m=m+str[i-1] else: m=m+"#" print(m) Show('HappyBirthday') 3 1+2=3 28 Write the definition of a Python function named LongLines ( ) which reads the contents of a text file named 'LINES.TXT' and displays those lines from the file which have at least 10 words in it. For example, if the content of ' LINES. TXT' is as follows: Once upon a time, there was a woodcutter He lived in a little house in a beautiful, green wood. One day, he was merrily chopping some wood. He saw a little girl skipping through the woods, whistling happily. The girl was followed by a big gray wolf. Then the function should display output as: He lived in a little house in a beautiful, green wood. He saw a little girl skipping through the woods, whistling happily. OR Write a function count_Dwords () in Python to count the words ending with a digit in a text file "Details.txt". Example: If the file content is as follows : On seat2 VIP1 will sit andOn seat1 VVIP2 will be sitting Output will be: Number of words ending with a digit are 4 29 3 2+1=3 Consider the table Personal given below: Based on the given table, write SQL queries for the following: (i) Increase the salary by 5% of personals whose allowance is known. (ii) Display Name and Total Salary (sum of Salary and Allowance) of all personals. The column heading Total Salary should also be displayed. (iii) Delete the record of Supervisors who have salary greater than 25000 30 31 A dictionary contains records of a tourist place like : Tour_dict = {'Name : 'Goa', 'PeakSeason : 'December , Budget : 15000,'Famous : 'Beaches'} Write the following user defined functions to perform given operations on the stack named tour : (i) Push_tour(Tour_dict) To Push a list containing values for Name and PeakSeason where value of budget is less than 10000 into the tour stack. (ii) Pop_tour() To Pop the list objects from the stack and display them. Also, display Nomore tours when there are no elements in the stack. SECTION - D Happy Faces Corporation has set up its new center at Noida, Uttar Pradesh for its office and web-based activities. It has 4 blocks of buildings. Distance between the various blocks is as follows: A to B 40 m B to C 120m C to D 100m A to D 170m B to D 150m 3 5 A to C 70m Numbers of computers in each block Block A -25 Block B - 50 Block C - 125 Block D - 10 a. Suggest and draw the cable layout to efficiently connect various blocks of buildings within the Noida center for connecting the digital devices. b. Which block will be best suitable to place the server and why? c. Suggest the placement of the following device with justification a. Repeater b. Hub/Switch d. Which kind of network (PAN/LAN/WAN) will be formed if the Noida office is connected to its head office in Mumbai? e. Which fast and very effective wireless transmission medium should preferably be used to connect the head office at Mumbai with the center at Noida? 32 33 34 5 A binary file Book.dat has structure [BookNo, Book_Name, Author, Price]. i. Write a user defined function CreateFile() to input data for a record and add to Book.dat . ii. Write a function CountRec(Author) in Python which accepts the Author name as parameter and count and return number of books by the given Author are stored in the binary file Book.dat OR A binary file STUDENT.DAT has structure (admission_number, Name, Percentage). Write a function countrec() in Python that would read contents of the file STUDENT.DAT and display the details of those students whose percentage is above 75. Also display number of students scoring above 75%. 1+4=5 (i) Define the term Domain with respect to RDBMS. Give one example to support your answer. (ii) Kabir wants to write a program in Python to insert the following record in the table named Student in MYSQL database, SCHOOL: rno(Roll number )- integer name(Name) string DOB (Date of birth) Date Fee float Note the following to establish connectivity between Python and MySQL: Username root Password - tiger SECTION - E 4 Write SQL commands for the queries (i) to (iii) and output for (iv) & (v) based on a table COMPANY and CUSTOMER. (i) To display those company name which are having price less than 30000. (ii) To display the name of the companies in reverse alphabetical order. (iii) To increase the price by 1000 for those customer whose name starts with S (iv) SELECT PRODUCTNAME,CITY, PRICE FROM COMPANY,CUSTOMER WHERE COMPANY.CID=CUSTOMER.CID AND PRODUCTNAME= MOBILE ; (v) SELECT AVG(QTY) FROM CUSTOMER WHERE NAME LIKE %r%; 35 Mr. Rowan Gunner is writing a program to create a CSV file user.csv which will contain user name and password for some entries. He has written the following code. As a programmer, help him to successfully execute the given task. a) Name the module he should import in Line 1. b) In which mode, Manish should open the file to add data into the file c) Fill in the blank in Line 3 to read the data from a csv file. d) Fill in the blank in Line 4 to close the file 4

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

© 2010 - 2025 ResPaper. Terms of ServiceContact Us Advertise with us

 

balps chat