Computer Science – Class 12 - Question Paper, Exams of Computer science

Computer Science – Class 12 - Question Paper – Multiple Choice Questions and Subjective Questions – 35 Questions – 1 2 3 4 & 5 marks Questions - 9 Pages – Helpful for Students appearing Board Examination and Teachers

Typology: Exams

2024/2025

Available from 09/09/2024

kbzone1973
kbzone1973 🇮🇳

244 documents

1 / 9

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CLASS : XII (SET 3) TIME ALOTTED : 3HRS
SUBJECT :COMPUTER SCIENCE (083) MAXIMUM MARKS : 70
General instructions:
This question paper contains five sections, Section A to E.
All questions are compulsory.
Section A have 18 questions carrying 01 mark each.
Section B has 07 Very Short Answer type questions carrying 02 marks each.
Section C has 05 Short Answer type questions carrying 03 marks each.
Section D has 03 Long Answer type questions carrying marks 05 each.
Section E has 02 questions carrying 04 marks each. One internal choice is given in Q34
against part C only.
All programming questions are to be answered using Python Language only.
SECTION A
1. say true or false : [1]
“ A dictonary key must be of a data type that is mutable
2. Which of the following statements is True? [1]
a) There can be only one Foreign Key in a table.
b) There can be only one Unique key is a table
c) There can be only one Primary Key in a Table
d) A table must have a Primary Key.
3. The correct syntax of seek() is: [1]
(a) file_object.seek(offset [, reference_point]) (b) seek(offset [, reference_point])
(c) seek(offset, file_object) (d)seek.file_object(offset)
4. What will be the output of the following python expression? print(2**3**2) [1]
a) 64 b) 256 c) 512 d) 32
5. The statement which is used to get the numbers of rows fetched by execute() method of
cursor [1]
a)cursor.rowcount b) cursor.rowcount() c)cursor.allrows() d) cursor.countrows()
6. is a non-key attribute, whose values are derived from the primary key of some other
table. [1]
(A) Primary Key (B) Candidate Key (C) Foreign Key (D) Alternate Key
7. The SELECT statement when combined with clause, returns records without
repetition. [1]
(A) DISTINCT (B) DESCRIBE (C) UNIQUE (D) NULL
08.which statement in SQL allows to change the definition of the table is [1]
a) alter b) update c)create d) select
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Computer Science – Class 12 - Question Paper and more Exams Computer science in PDF only on Docsity!

CLASS : XII (SET – 3) TIME ALOTTED : 3HRS

SUBJECT :COMPUTER SCIENCE (083) MAXIMUM MARKS : 70

General instructions:

  • This question paper contains five sections, Section A to E.
  • All questions are compulsory.
  • Section A have 18 questions carrying 01 mark each.
  • Section B has 07 Very Short Answer type questions carrying 02 marks each.
  • Section C has 05 Short Answer type questions carrying 03 marks each.
  • Section D has 03 Long Answer type questions carrying marks 05 each.
  • Section E has 02 questions carrying 04 marks each. One internal choice is given in Q against part C only.
  • All programming questions are to be answered using Python Language only. SECTION – A
  1. say true or false : [1] “ A dictonary key must be of a data type that is mutable
  2. Which of the following statements is True? [1]

a) There can be only one Foreign Key in a table.

b) There can be only one Unique key is a table

c) There can be only one Primary Key in a Table

d) A table must have a Primary Key.

  1. The correct syntax of seek()is: [1] (a) file_object.seek(offset [, reference_point]) (b) seek(offset [,reference_point]) (c) seek(offset, file_object) (d)seek.file_object(offset)

  2. What will be the output of the following python expression?print(232) [1] a) 64 b) 256 c) 512 d) 32

  3. The statement which is used to get the numbers of rows fetched by execute() method of cursor [1] a)cursor.rowcount b) cursor.rowcount() c)cursor.allrows() d) cursor.countrows()

  4. is a non-key attribute, whose values are derived from the primary key of some other table. [1] (A) Primary Key (B) Candidate Key (C) Foreign Key (D) Alternate Key

  5. The SELECT statement when combined with clause, returns records without repetition. [1] (A) DISTINCT (B) DESCRIBE (C) UNIQUE (D) NULL 08 .which statement in SQL allows to change the definition of the table is [1] a) alter b) update c)create d) select

  1. Which functions is used to close a file in python? [1] (A) close (B) cloose() (C) Close() (D) close()
  2. Which of the following is not a valid python operator? [1] a) % b) in c) # d) **
  3. Select the correct output of the following python Code: [1] str="My program is program for you" t = str.partition("program") print(t)

a) ('My ', 'program', ' is ', 'program' , ' for you')

b) ('My ', 'program', ' is program for you')

c) ('My ', ' is program for you') d) ('My ', ' is ', ' for you')

  1. Which of the following is used to receive emails over Internet? [1]

a) a) SMTP b) POP 3 c) PPP d) VoIP 8.

  1. protocol provides access to command line interface on a remote computer.

b) (a) FTP (b) PPP (c) Telnet (d) SMTP [1]

  1. Which of the following is not a legal method for fetching records from a database from within aPython program? [1] (a) fetchone() b)fetchtwo() (c) fetchall() (d) fetchmany()
  2. What will the following code do? [1] dict={"Exam":"AISSCE", "Year":2022} dict.update({"Year”:2023}) a.It will create new dictionary dict={” Year”:2023}and old dictionary will be deleted b. It will throw an error and dictionary cannot updated c. It will make the content of dictionary as dict={"Exam":"AISSCE","Year":2023} d. It will throw an error and dictionary and do nothing
  3. Q1 6 and 1 7 are ASSERTION AND REASONING based questions. Mark the correct choice as [1] (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
  4. Assertion (A):- If the arguments in a function call statement match the number and order of arguments as defined in the function definition, such arguments are called positional arguments. Reasoning (R):- During a function call, the argument list first contains default argument(s) followed by positional argument(s).
  5. Assertion (A): CSV (Comma Separated Values) is a file format for data storage which looks like atext file. Reason (R): The information is organized with one record on each line and each field is separatedby comma

18. Consider the given expression: not ((True and False) or True) [1] Which of the following will be correct output if the given expression is evaluated? (A) True (B) False (C) NONE (D) NULL

HALDIRAM SALTY 10 20

HALDIRAM TOMATO 25 30

(i) Select BRAND_NAME, FLAVOUR from CHIPS where PRICE <> 10; (ii) Select * from CHIPS where FLAVOUR=”TOMATO” and PRICE > 20; (iii) Select BRAND_NAME from CHIPS where price > 15 and QUANTITY < 15; (iv) Select count( distinct (BRAND_NAME)) from CHIPS;

  1. A pre-existing text file data.txt has some words written in it. Write a pythonfunction displaywords() that will print all the words that are having length greater than 3. [3] Example: For the fie content: A man always wants to strive higher in his lifeHe wants to be perfect. The output after executing displayword() will be: Always wants strive higher life wants perfect OR A pre-existing text file info.txt has some text written in it. Write a pythonfunction countvowel() that reads the contents of the file and counts the occurrence of vowels(A,E,I,O,U) in the file.
  2. Based on the given set of tables write answers to the following questions. [3] Table: flights flightid Model Company 10 747 Boeing 12 320 Airbus 15 767 Boeing Table: Booking Ticketno passenger source Destination quantity price Flightid 10001 ARUN BAN DEL 2 7000 10 10002 ORAM BAN KOL 3 7500 12 10003 SUMITA DEL MUM 1 6000 15 10004 ALI MUM KOL 2 5600 12 10005 GAGAN MUM DEL 4 5000 10

a) Write a query to display the passenger, source, model and price for allbookings

whose destination is KOL.

b) Identify the column acting as foreign key and the table name where it

is present in the given example.

29. A function INDEX_LIST(L), where L is the list of elements passed as argument to the

function. The function returns another list named ‘indexList’ that stores the indices of all Non- Zero Elements of L. [3] For example: If L contains [12,4,0,11,0,56]

The indexList will have - [0,1,3,5]

  1. A list contains following record of a customer: [3] [Customer_name, Phone_number, City] Write the following user defined functions to perform given operations on the stack named ‘status’: (i) Push_element() - To Push an object containing name and Phone number of customers who live in Goa to the stack (ii) Pop_element() - To Pop the objects from the stack and display them. Also, display “Stack Empty” when there are no elements in the stack. For example: If the lists of customer details are: [“Ashok”, “9999999999”,”Goa”] [“Avinash”, “8888888888”,”Mumbai”] [“Mahesh”,”77777777777”,”Cochin”] [“Rakesh”, “66666666666”,”Goa”] The stack should contain: [“Rakesh”,”66666666666”] [“Ashok”,” 99999999999”] The output should be: [“Ashok”,”99999999999”] Stack Empty OR Vedika has created a dictionary containing names and marks as key-value pairsof 5 students. Write a program, with separate user-defined functions to perform the following operations: (i) Push the keys (name of the student) of the dictionary into a stack, where the corresponding value (marks) is greater than 70. (ii) Pop and display the content of the stack. The dictionary should be as follows: d={“Ramesh”:58, “Umesh”:78, “Vishal”:90, “Khushi”:60, “Ishika”:95} Then the output will be: Umesh Vishal Ishika SECTION D
  2. Trine Tech Corporation (TTC) is a professional consultancy company. The company is planning to set up their new offices in India with its hub at Hyderabad. As a network adviser, you have to understand their requirement and suggest them the best available solutions. Their queries are mentioned as (i) to (v) below. [5]

mycon. #Statement 3 Write the missing statement: Statement1 , Statement2 and Statement OR (a) Predict the output of the code given below: (b) The code given below reads the following record from the tablenamed student and displays only those records who have marks greater than 80: RollNo – integer Name – string Clas – integer Marks – integer Note the following to establish connectivity between Python andMYSQL:

  • Username is root
  • Password is tiger
  • The table exists in a MYSQL database named kvs. Write the following missing statements to complete the code: Statement 1 – to form the cursor object Statement 2 – to execute the query that extracts records of thosestudents whose marks are greater than 80. Statement 3- to read the complete result of the query (records whose marks are greater than 80) into the object named data, from thetable studentin the database.
  1. import mysql.connector as mysql [ 5 ] def sql_data(): con1=mysql.connect(host="localhost",user="root",passwo rd="tiger", database="school") mycursor= #Statement 1 print("Students with marks greater than 75 are : ") ----------------------------------- #Statement 2 data= #Statement 3 for i in data: print(i) SECTION E
  2. Mayank creates a table RESULT with a set of records to maintain the marks secured by students in sub1, sub2, sub3 and their GRADE. After creation of the table, he has entered data of 7 students in the table. [4] Table : RESULT ROLL_ NO SNAME sub1 sub2 sub3 GRAD E 101 KIRAN 366 410 402 I 102 NAYAN 300 350 325 I 103 ISHIKA 400 410 415 I 104 RENU 350 357 415 I 105 ARPITA 100 75 178 IV

106 SABRINA 100 205 217 II

107 NEELIMA 470 450 471 I

103 ISHIKA 400 410 415 I

Based on the data given above answer the following questions: (i) Identify the most appropriate column, which can be considered as Primary key. (ii) If two columns are added and 2 rows are deleted from the table result, what will be the new degree and cardinality of the above table? (iii) Write the statements to: a. Insert the following record into the table Roll No- 108, Name- Aaditi, sub1- 470, sub2-444, sub3- 475, Grade– I. b. Increase the sub2 marks of the students by 3% whose name begins with ‘N’. OR (Option for part iii only) (iii) Write the statements to: a. Delete the record of students securing Grade-IV. b. Add a column REMARKS in the table with datatype as varcharwith 50 characters.

  1. Reshabh is a programmer, who has recently been given a task to write a python code to perform the following binary file operations with the help of two user defined [4] functions/modules: a. AddStudents() to create a binary file called STUDENT.DAT containing student information – roll number, name and marks (out of 100) of each student. b. GetStudents() to display the name and percentage of those students who have a percentage greater than 75. In case there is no student having percentage > 75 the function displays an appropriate message. The function should also display the average percent. He has succeeded in writing partial code and has missed out certain statements, so he has left certain queries in comment lines. You as an expert of Python have to provide the missing statements and other related queries based on the following code of Reshabh. import pickle def AddStudents(): _____________________# statement 1 to open the binary file to write data while True: Rno = int(input("Rno :")) Name = input("Name : ") Percent = float(input("Percent :")) L = [Rno, Name, Percent] __________________#statement 2 to write the list L into the file Choice = input("enter more (y/n): ") if Choice in "nN": break F.close() def GetStudents(): Total=0 Countrec= Countabove75= with open("STUDENT.DAT","rb") as F: while True: try: ___________________ #statement 3 to read from the file Countrec+= Total+=R[2] if R[2] > 7 5: print(R[1], " has percent =",R[2]) Countabove75+=