0% found this document useful (0 votes)
8 views

2412_Computer_Science

This document outlines the structure and content of a test paper for a Pre-Medical Enthusiast Course in Computer Science for the academic session 2024-2025. It includes general instructions, a breakdown of sections with varying question types and marks, and specific questions related to Python programming and SQL. The test consists of 37 questions across five sections, focusing on theoretical knowledge and practical coding skills.

Uploaded by

rameshniggger
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

2412_Computer_Science

This document outlines the structure and content of a test paper for a Pre-Medical Enthusiast Course in Computer Science for the academic session 2024-2025. It includes general instructions, a breakdown of sections with varying question types and marks, and specific questions related to Python programming and SQL. The test consists of 37 questions across five sections, focusing on theoretical knowledge and practical coding skills.

Uploaded by

rameshniggger
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

(1001CMD303029240052) *1001CMD303029240052* Test Pattern

CLASSROOM CONTACT PROGRAMME Board Pattern


MAJOR
(Academic Session : 2024 - 2025) 24-12-2024
PRE-MEDICAL : ENTHUSIAST COURSE - ALL PHASE
COMPUTER SCIENCE
Time Allowed : 3 Hours Maximum Marks : 70

General Instructions:

(i) Please check this question paper contains 37 questions.


(ii) The paper is divided into 5 Sections- A, B, C, D and E.
(iii) Section A, consists of 21 questions (1 to 21). Each question carries 1 Mark.
(iv) Section B, consists of 7 questions (22 to 28). Each question carries 2 Marks.
(v) Section C, consists of 3 questions (29 to 31). Each question carries 3 Marks.
(vi) Section D, consists of 4 questions (32 to 35). Each question carries 4 Marks.
(vii) Section E, consists of 2 questions (36 to 37). Each question carries 5 Marks.
(viii) All programming questions are to be answered using Python Language only.

SECTION-A
1. State True or False. [1]
"Variable declaration is implicit in Python."
2. Which of the following is an invalid data type in Python? [1]
(A) Set (B) None (C) Integer (D) Real
3. Give the following dictionaries [1]
dict_exam={"Exam" : "AISSCE", "Year" : 2023}
dict_result={"Total" : 500, "Pass_Marks" : 165}
Which statement will merge the contents of both dictionaries?
(A) dict_exam.update (dict_result) (B) dict_exam + dict_result
(C) dict_exam.add (dict_result) (D) dict_exam.merge(dict_result)
4. Consider the given expression : [1]
not True and False or True
Which of the following will be correct output if the given expression is evaluated?
(A) True (B) False (C) NONE (D) NULL
5. Select the correct output of the code: [1]
a = "Year 2022 at All the best"
a = a.split('2')
b = a[0] + "." + a[1] + "." + a[3]
print (b)
(A) Year .0. at All the best (B) Year 0. at All the best
(C) Year . 022. at All the best (D) Year .0. at all the best

unz

6. Which of the following mode in file opening statement results or generates an error if the file does not exist? [1] 2

(A) a+ (B) r+ (C) w+ (D) None of the above


7. Fill in the blank : [1]
__________ command is used to remove primary key from the table in SQL.
(A) update (B) remove
(C) alter (D) drop
8. Which of the following commands will delete the table from MYSQL database? [1]
(A) DELETE TABLE (B) DROP TABLE
(C) REMOVE TABLE (D) ALTER TABLE
9. Which of the following statement(s) would give an error after executing the following code? [1]
S="Welcome to class XII" # Statement 1
print(S) # Statement 2
S="Thank you " # Statement 3
S[0]= '@' # Statement 4
S=S+"Thank you " # Statement 5
(A) Statement 3 (B) Statement 4 (C) Statement 5 (D) Statement 4 & 5
10. Fill in the blank : [1]
_________ is a non-key attribute, whose values are derived from the primary key of some other table.
(A) Primary Key (B) Foreign Key
(C) Candidate Key (D) Alternate Key
11. 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
12. Fill in the blank : [1]
The SELECT statement when combined with _________ clause, returns records without repetition.
(A) DESCRIBE (B) UNIQUE (C) DISTINCT (D) NULL
13. Fill in the blank : [1]
__________ is a communication methodology designed to deliver both voice and multimedia communications
over Internet protocol.
(A) VoIP (B) SMTP (C) PPP (D) HTTP
14. What will the following expression be evaluated to in Python? [1]
print(15.0 / 4 + (8 + 3.0))
(A) 14.75 (B) 14.0 (C) 15 (D) 15.5
15. Which function is used to display the total number of records from table in a database? [1]
(A) sum(*) (B) total(*) (C) count(*) (D) return(*)

unz

16. To establish a connection between Python and SQL database, connect () is used. Which of the following
arguments may not necessarily be given while calling connect()? [1]
(A) host (B) database (C) user (D) password
17. Which protocol is used to transfer files over the internet? [1]
(A) HTTP (B) FTP (C) PPP (D) HTTPS
18. Which network device is closed to connect two network that use different protocols? [1]
(A) Modem (B) Gateway (C) Switch (D) Repeater
19. Which switching technique breaks data into smaller packets for transmission allowing multiple packets to
share the same network resources? [1]
20 & 21 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 of A.
(B) Both A and R are true and R is not the correct explanation of A.
(C) A is true but R is false.
(D) A is false but R is true.
20. Assertion (A) : If the arguments in function call statement match the number and order of arguments as
defined in the function definition, such arguments are called positional arguments. [1]
Reason (R) : During a function call, the argument list first contains default argument(s) followed by positional
arguments(s).
21. Assertion (A) : CSV (Comma Separated Values) is a file format for data storage which looks like a text file. [1]
Reason (R) : The information is organized with one record on each line and each field is separated by comma.

SECTION-B
22. Rao has written a code to input a number and check whether it is prime or not. His code is having errors.
Rewrite the correct code and underline the corrections made. [2]
def prime():
n=int(input("Enter number to check :: ")
for i in range (2, n//2):
if n%i=0:
print("Number is not prime \n")
break
else:
print("Number is prime \n')
23. Write two points of difference between Circuit Switching and Packet Switching. [2]
24. (a) Given is a Python string declaration : [2]
myexam="@@CBSE Examination 2022@@"
Write the output of : print(myexam[::–2])

unz

OR
(b) Write the output of the code given below:
my_dict = {"name": "Aman", "age": 26}
my_dict['age'] = 27
my_dict['address'] = "Delhi"
print(my_dict.items())
25. Predict the output of the Python code given below : [2]
def Diff(N1,N2):
if N1>N2
return N1-N2
else:
return N2-N1
NUM= [10,23,14,54,32]
for CNT in range (4,0,-1):
A=NUM[CNT]
B=NUM[CNT-1]
print(Diff(A,B),'#', end=' ')
26. Predict the output of the Python code given below :
tuplel = (11, 22, 33, 44, 55, 66)
list1 =list(tuplel)
new_list = []
for i in list1:
if i%2= =0;
new_list.append(i)
new_tuple = tuple(new_list)
print(new_tuple)
27. Differentiate between count() and count(*) functions in SQL with appropriate example. [2]
OR
Categorize the following commands as DDL or DML:
INSERT, UPDATE, ALTER, DROP
28. (a) Write the full forms of the following : [2]
(i) SMTP
(ii) PPP
OR
(b) What is the use of TELNET?

unz

SECTION-C
29. Write a method COUNTLINES() in Python to read lines from text file 'TESTFILE.TXT' and display the lines
which are not starting with any vowel.
Example :
If the file content is as follows :
An apple a day keeps the doctor away.
We all pray from everyone's safety.
A marked difference will come in our country.
The COUNTLINES() function should display the output as:
The number of lines not starting with any vowel-1 [3]
OR
Write a function ETCount() in Python, which should read each character of a text file "TESTFILE.TXT" and
then count and display the count of occurrence of alphabets E and T individually (including small cases e and t
too).
Example :
If the file content is as follows :
Today is a pleasant day.
It might rain today.
It is mentioned on weather sites
The ETCount() function should display the output as:
E or e: 6
T or t: 9
30. A list contains following record of a sustomer:
[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 and 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 :
["Gurdas", "9999999999", "Goa"]
["Julee", "8888888888", "Mumbai"]
["Murugan", "77777777777", "Cochin"]
["Asmit", "1010101010", "Goa"]
The stack should contain
["Ashmit", "1010101010"]
["Gurdas", "9999999999"]
The output should be :
["Ashmit", "1010101010"]
["Gurdas", "9999999999"]
Stack Empty [3]

unz

OR
Write a function in Python, Push(SItem) where, SItem is a dictionary containing the details of stationary
items-{Sname : price} .
The function should push the names of those items in the stack who have price greater then 75. Also display
the count of elements pushed into the stack.
For example :
If the dictionary contains the following data:
Ditem={"Pen":106,"Pencil":59,"Notebook":80,"Eraser":25}
The stack should contain
Notebook
Pen
The output should be :
The count of elements in the stack is 2
31. (a) Write the output of the code given below : [5]
p=5
def sum(q, r=2):
global p
p=r+q**2
print(p, end= '#')
a=10
b=5
sum(a,b)
sum(r=5,q=1)
OR
(b) Predict the output of the code given below:
s="welcome2cs"
n = len(s)
m=""
for i in range (0, n):
if (s[i] >= 'a' and s[i] <= 'm'):
m = m + s[i].upper()
elif (s[i] >= 'n' and s[i] <= 'z'):
m = m + s[i–1]
elif (s[i].isupper()):
m = m + s[i].lower()
else:
m = m + '&'
print(m)

unz

SECTION-D
32. (a) Write the output of the SQL queries (i) to (iv) based on the relations Teacher and Placement given
below :
Table : Teacher
T_ID NAME Age Department Date_of_join Salary Gender
1 Arunan 34 Computer Science 2019-01-10 12000 M
2 Suman 31 History 2017-03-24 20000 F
3 Randeep 32 Mathematics 2020-12-12 30000 M
4 Samira 35 History 2018-07-01 40000 F
5 Raman 42 Mathematics 2021-09-05 25000 M
6 Shyam 50 History 2019-06-27 30000 M
7 Shiv 44 Computer Science 2019-02-25 21000 M
8 Shalakha 33 Mathematics 2018-07-31 20000 F

Table : Placement
P_ID Department Place
1 History Ahmedabad
2 Mathematics Jaipur
3 Computer Science Nagpur

(i) SELECT Department, avg(salary) FROM teacher GROUP BY department;


(ii) SELECT MAX(Date_of_Join),MIN(Date_of_Join) FROM Teacher;
(iii) SELECT Name, Salary, T.Department, Place FROM teacher T, Placement P
where T.Department = P.Department AND Salary>20000;
(iv) SELECT Name, Place FROM Teacher T, Placement P
WHERE Gender = 'F' AND T.Department=P.Department;
OR
(b) Write the command to view all tables in a database. [3]
33. What is the advantage of using a csv file for permanent storage? [5]
Write a Program in Python that defines and calls the following user defined function:
(i) ADD() – To accept and add data of an employee to a CSV file 'record.csv'. Each record consists of a list
with field elements as empid, name and mobile to store employee id, employee name and employee
salary respectively.
(ii) COUNTER() – To count the number of records present in the CSV file named 'record.csv'.

unz

34. Navdeep creates a table RESULT with a set of records to maintain the marks secured by students
in Sem 1, Sem 2, Sem 3 and their division. After creation of the table, he has entered data of
7 students in the table. [4]
ROLL_NO SNAME SEM 1 SEM 2 SEM 3 DIVISION
101 KARAN 366 410 402 I
102 NAMAN 300 350 325 I
103 ISHA 400 410 415 I
104 RENU 350 357 415 I
105 ARPIT 100 75 178 IV
106 SABINA 100 205 217 II
107 NEELAM 470 450 471 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 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-Aadit, Sem1-470, Sem2-444, Sem3-475, Div-I.
(b) Increase the SEM2 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 IV division.
(b) Add a column REMARKS in the table with datatype as varchar with 50 characters.
35. The code given below reads the following record from the table named student and displays only those records
who have marks greater than 75:
RollNo – integer
Name – string
Class – integer
Marks – integer
Note the following to establish connectivity between Python and MYSQL
 Username is root
 Password is tiger
 The table exists in a MYSQL database named school.
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 those students whose marks are greater than
75.

unz

Statement 3 – to read the complete result of the query (records whose marks are greater
than 75) into the object named data, from the table student in the database. [4]
import mysql.connector as mysql
def sql_data():
conl=msql.connect(host="localhost",user="root",password="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)
print()

SECTION-E
36. Aman is a Python programmer. He has written a code and created a binary file record.dat with employee id,
ename and salary. The file contains 10 records. [5]
He now has to update a record based on the employee id entered by the user and update the salary. The
updated record is then to be written in the file temp.dat . The records which are not to be updated also have to
be written to the fiel temp.dat. If the employee id is not found, an appropriate message should to be
displayed.
As a python expert, help him to complete the following code based on the requirement given above:
import __________ #Statement 1
def update_data():
rec={}
fin=open("record.dat","rb")
fout=optn("__________") #Statement 2
found=False
eid=int(input("Enter employee id to update their salary :: "))
while True
try:
rec=__________ #Statement 3
if rec ["Employee id"] = =eid:
found=True
rec["Salary"]=int(input("Enter new salary :: "))
pickle.__________ #Statement 4
else:
pickle.dump(rec,fout)

unz

except :
break
if found= =True:
print("The salary of employee id ", eid," has been update.")
else:
print("No employee with such id is not found")
fin. close()
fout.close
(i) Which module should be imported in the program? (Statement 1)
(ii) Write the correct statement required to open a temporary file name temp.dat. (Statement 2)
(iii) Which statement should Aman fill in Statement 3 to read the data from the binary file, record.dat and
in Statement 4 to write the updated data in the file, temp.dat? [1+1+3=5]
37. MakeInIndia 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 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 questions nos. (i) to (v), keeping in mind the distances
between various blocks/locations and other given parameters. [5]

Kashipur
APP Campus Movie
Develop Editing
Mussoorie ment
Campus Web
Designing

Distance between various blocks/locations :


Block Distance
App development to Web designing 28 m
App development to Movie editing 55 m
Web designing to Movie editing 32 m
Kashipur Campus to Mussoorie Campus 232 m
Number of computers
Block Number of Computers
App development 75
Web designing 50
Movie editing 80

unz

(i) Suggest the most appropriate block/location to house the server in the Kashipur campus (out of the 3
block) to get the best and effective connectivity. Justify your answer.
(ii) Suggest a device/software to be installed in the Kashipur Campus to take care of data security.
(iii) Suggest the best wired medium and draw the cable layout (Block to Block) to economically connect
various blocks within the Kashipur Campus.
(iv) Suggest the placement of the following devices with appropriate reasons :
(a) Switch/Hub (b) Repeater
(v) Suggest a protocol that shall be needed to provide Video Conferencing solution between Kashipur
Campus and Mussoorie Campus.
OR
Write two points of difference between XML and HTML.








unz



 CAREER INSTITUTE Pvt. Ltd.
Registered & Corporate Office : 'SANKALP', CP-6, Indra Vihar, Kota (Rajasthan) INDIA-324005
Ph. : +91-744-3556677, +91-744-2757575|E-mail : info@allen.in|Website : www.allen.ac.in

unz

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy