We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5
SAINIK SCHOOL AMARAVATHINAGAR
3RD PREBOARD (2024-25) MS
CLASS XII COMPUTER SCIENCE
Time allowed: 3 Hours SET:B Maximum Marks: 70
Q No. Section-A (21 x 1 = 21 Marks) Marks
1. False (1) 2. (A) Annual—Examination—2024— (1) 3. (B) False (1) 4. (C) ['ce', 'wi'] (1) 5. 0 (1) 6. (B) (45, 6, 2), error (1) 7. (B) {1: ["Rahul", 95], 2: ["Siya", 90], 5: ["Rajan", 80]} (1) 8. (D) Statement 1 and Statement 4 (1) 9. (A) allows, and (1) 10. (D) <fileobject>.flush() (1) 11. True (1) 12. (B) -2 (1) 13. DESCRIBE table_name; (1) 14. (C) 30, 15 (1) 15. (A) Domain (1) 16. (A) ORDER BY (1) 17. (A) (D) Interlinking of collection of webpages is called Internet. (1) 18. Mesh topology (1) 19. (C) (B) Gateway 20. (A) Both A and R are true and R is the correct explanation for A (1) 21. (D) Both A is False but R is True (1) Q No Section-B ( 7 x 2=14 Marks) Marks 22. Lists cannot be used as keys in a dictionary because they are mutable. (2) sum(D) returns 6, and sort(D) will throw an error as dictionaries do not have a sort method. 23. Give output of: (2) (A) 7-2**3+5/3 (B) not(False)and True or False and True 24. 0.667(Approx) (2) (A) True 25. (A) ComputerScienceExamination2024 (2) (B) ComputerScienceExamination2024 omputerScienceExamination202
26. Find the error in the given code: (2)
even_no=odd_no=0 for i in range(0,len (L)): if L[i]%2==0: even_no+=1 else: odd_no+=1 print(even_no, odd_no) 27. I update student set phone='new_number' where name='rohan'; 24. (2) OR drop table student; II alter table employee add blood_group varchar(3) not null; OR alter table employee change dob birthdate date; 28. (2) Packet Switching Circuit Switching Data is divided into packets, Entire message is sent together
Each packect may take A dedicated communication path is established between
different routes to reach the the sender and receiver for the entire duration of the destination. communication. More efficient for data Less efficient for data transmission transmission OR XML (eXtensible Markup Language) is used for data storage; HTML (Hypertext Markup Language) is for web presentation Q No. Section-C ( 3 x 3 = 9 Marks) Marks 29. Write a Python function dispdigit() reads a text file “test.txt” and that displays (3) all the digits in the file. OR Write a Python function disp() that finds and displays longest line of the file “test.txt” 30. def push_students_with_high_marks(student_dict): (3) for name, marks in student_dict.items(): if marks > 75: stack.append(name) def pop_and_display_stack(): while stack: print(stack.pop(), end=" ") print() # New line after displaying stack def peep_stack(): if stack: print("Last value in stack:", stack[-1]) else: print("Stack is empty") OR num_stack = [] # Stack to store numbers > 99 (A) Push numbers > 99 onto the stack def push(N): for num in N: if num > 99: num_stack.append(num) (B) Pop topmost string and return its length, or display "Empty" if stack is empty def pop(): if num_stack: top_element = num_stack.pop() return len(str(top_element)) else: print("Empty") (C) Display all elements of the stack or 'None' if empty def Disp(): if num_stack: print("Stack contents:", num_stack) else: print("None") 31. value before 50 (3) value in function 30 value in function -50 value after -50 OR $$$$rPRoBOARd202$$$$ Q No. Section-D ( 4 x 4 = 16 Marks) Marks 32. (A) CREATE TABLE Product ( Pno INT PRIMARY KEY, Pname VARCHAR(50), (4) Quantity INT, PurchaseDate DATE ); (B) SELECT Pno, Pname FROM Product WHERE Quantity < 150; (C) INSERT INTO Product (Pno, Pname, Quantity, PurchaseDate) VALUES (117, 'Stapler', 65, ' (D) 2014-12-23'); (D) (E) UPDATE Product SET Quantity = Quantity + 10 WHERE PurchaseDate = '2011-12-12'; OR (A) SUM(Qty) 1383 (B) COUNT(*) 3 (C) Pno Name Qty 102 Pencil 201 109 Sharpener 90 (D) MAX(Qty) 900 33. (A) import csv (4) def ADD(): admnno = input("Enter admission number: ") name = input("Enter student name: ") student_class = input("Enter student class: ") student_data = [admnno, name, student_class] with open('record.csv', mode='a', newline='') as file: writer = csv.writer(file) writer.writerow(student_data) print("Record added successfully!") (B) def DisplayR12() with open('record.csv', mode='r') as file: reader = csv.reader(file) for row in reader: if row[2] == '12': # Assuming the class is stored in the 3rd column print(" | ".join(row)) 34. (A) Select name from staff where dept = 'sales' and experience > 10; (B) select s.name, (sal.basic + sal.allowance) as salary from staff s join salary sal on s.id = sal.id where s.dept = 'finance'; (C) select min(sal.allowance) as min_allowance from staff st join salary sal on st.id = sal.id where st.gender = 'f'; (D) select max(sal.commission%) as max_commission from staff st join salary sal on st.id = sal.id where st.gender = 'm'; OR (D) select s.id, s.name, s.dept, s.gender, s.experience, sal.basic, sal.allowance, sal.commission% from staff s left join salary sal on s.id = sal.id; 35. import mysql.connector (4) conn = mysql.connector.connect( host="localhost", user="root",password="12345", database="INVENTORY") cursor = conn.cursor() query = "SELECT * FROM Vehicle WHERE type = 'Luxury'" cursor.execute(query) records = cursor.fetchall() if records: for record in records: print(f"VID: {record[0]}, Vehicle Name: {record[1]}, Cost: {record[2]}, Type: {record[3]}") else: print("No records found with the type 'Luxury'.") cursor.close() conn.close() Q.No. SECTION E (2 X 5 = 10 Marks) Marks 36. import pickle (5) def FindBook(price): with open("SCHOOL.DAT", "rb") as file: while True: try: record = pickle.load(file) if record['LOCATION'] == 'Greater Noida': print(record) except EOFError: break def Add(): school_no = int(input("Enter School Number: ")) name = input("Enter School Name: ") location = input("Enter School Location: ") new_record = {'SCHOOL_NO': school_no, 'NAME': name, 'LOCATION': location} with open("SCHOOL.DAT", "ab") as file: # 'ab' mode for appending binary data pickle.dump(new_record, file) print("New record added successfully.") def Modify(): records = [] with open("SCHOOL.DAT", "rb") as file: while True: try: records.append(pickle.load(file)) except EOFError: break for record in records: if record['SCHOOL_NO'] == 12344: record['NAME'] = 'BPP School' print("Record modified successfully.") break else: print("No record found with SCHOOL_NO 12344.") with open("SCHOOL.DAT", "wb") as file: for record in records: pickle.dump(record, file) 37. (A) Building 3,with maximum Computers (5) (B) Bus/Star (C) In all the buildings (D) Use fiber optics for 120m distance (E) Telnet