0% found this document useful (0 votes)
769 views9 pages

Grade12 Computer Set1 AK Sahodaya

Uploaded by

ak2katyal
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)
769 views9 pages

Grade12 Computer Set1 AK Sahodaya

Uploaded by

ak2katyal
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/ 9

BANGALORE SAHODAYA SCHOOLS COMPLEX

ASSOCIATION

PRE-BOARD EXAMINATION (2023-2024)


Grade XII
SET - I
Date: Max. Marks: 70
Subject: Computer Science (083) Time: 3 Hours

ANSWER KEY

SECTION - A

SL. ANSWER M
NO

1 True 1

2 d) Drop 1

3 c) 6.3 1

4 15 1

5 (a) SELECT * FROM EMP WHERE NAME LIKE "_S%"; 1

6 bps, Kbps, Mbps, Gbps, Tbps 1

7 b. del D1["Orange"] 1

8 Show tables; 1

9 d. Statement 2 & statement 4 1

10 Costliest wired: Optical fiber, Wireless: Satellite 1

11 WAN 1

12 Primary key 1

1
13 False 1

14 b) Update more than one row at a time 1

15 b) Master-Slave network 1

16 a, a+ modes 1

17 a) 1

18 a) 1

SECTION - B

19 i) 1+1=2
a. SMTP – Simple Mail Transfer Protocol
b. PPP – Point to Point Protocol
ii) Telnet is used for remote connection
(OR)
i)
a. VOIP- Voice Over Internet Protocol
b. TCP – Transmission Control Protocol
ii)
PAN:
• It stands for Personal Area Network
• It spans over a few meters.
LAN:
• It stands for Local Area Network
• It spans over a few Km.
20 2

21 def count(CITIES): 2
for city_name, city_info in CITIES.items():
if len(city_name) > 5:
print(city_name.upper())
CITIES={1:"Delhi",2:"MUMBAI",3:"CHENNAI",4:"KOLKATA"}
count(CITIES)

2
function definition – ½ mark
checking the condition using length function – 1 mark
calling the function – ½ mark
(OR)
def length(words):
word_list = words.split()
word_lengths = [len(word) for word in word_list]
return word_lengths

input_string = "This is a sample string"


result = length(input_string)
print(result)
function definition – ½ mark
checking the condition using length function – 1 mark
calling the function – ½ mark
22 [100] 2

23 i) L1.insert(3, 400) 1+1=2

ii) if message.endswith('.'):

print("The string ends with a full stop.")

else:

print(“The string does not ends with full stop.”)

(Each 1 mark)

24 SELECT Student.Rollno, Student.Admno, Student.name, Student.Class, Fees.FeeID, 2


Fees.amount
FROM Student
INNER JOIN Fees ON Student.Rollno = Fees.Rollno;
(OR)
ALTER TABLE ORDER ADD COLUMN CNAME VARCHAR(30);
ALTER TABLE ORDER DROP COLUMN DOD;
(Each 1 mark)
25 22 $ 68 $ 9 $ 33 $ 2

SECTION - C

26 ***** 3

3
27 i. Item code 3
ii. INSERT INTO FRESH (ITEMCODE, ITEMNAME, SCODE) VALUES
(1007,”GINGER”,15)
iii. ALTER TABLE FRESH ADD COLUMN PRICE FLOAT;

28 def display(file_path): 3
vowels = ['a', 'e', 'i', 'o', 'u']
try:
with open(file_path, 'r') as file:
for line in file:
line = line.strip() # Remove leading and trailing whitespaces
if line and line[0].lower() in vowels:
print(line)
except FileNotFoundError:
print(f"File '{file_path}' not found.")
except Exception as e:
print(f"An error occurred: {e}")

file_path = 'sample.txt'
display_lines_starting_with_vowel(file_path)

Function definition – ½ mark


Opening a file – ½ mark
Logic- 2 mark
(Mark can be awarded to any program that does the same task)

(OR)
def count_words(file_path):
try:
with open(file_path, 'r') as file:
text = file.read()
words = text.split()
num_words = len(words)
print(f"Number of words in '{file_path}': {num_words}")
except FileNotFoundError:
print(f"File '{file_path}' not found.")
except Exception as e:
print(f"An error occurred: {e}")

# Example usage:
file_path = 'sample.txt'

4
count_words(file_path)

Function definition – ½ mark


Opening a file – ½ mark
Logic- 2 mark
(Mark can be awarded to any program that does the same task)
29 3

i.

ii.

iii.
30 3

creating the function for add_client & remove client- ½ mark


checking whether the stack is empty or not – ½ mark
logic – 2 marks

5
(Mark can be awarded to any program that does the Push and pop operation of a
stack)
SECTION - D

31 4

i.

ii.

iii.

iv.
32 4

SECTION- E

33 a) Building jamuna, since it has more no of computers. 1*5=


b) Star cable layout or topology
c) Switch should be placed between the buildings, Repeater should be placed if the 5
distance between the blocks is greater than 100 mts.
d) Optical fiber
e) WAN, since the distance is greater than 1 KM

6
34 i) “w” mode in python represents, write which erases the previous data and the new data is 2+3
copied. The file pointer of write mode will be at the beginning. If the file is not present in
w mode the program will not give any error instead the file will be automatically created
with the name specified.
In append mode ‘a’, the data will not be erased, the new data will be copied to the end of
the file. The file pointer in append mode will be at the end.
ii)
import pickle
def copy(input_filename, output_filename):
total_records_copied = 0
try:
with open(input_filename, 'rb') as infile, open(output_filename, 'wb') as outfile:
for line in infile:
movie_name, movie_id, no_of_theatres = line.strip().split(', ')
if movie_name == "KAALAI":
outfile.write(f"{movie_name}, {movie_id}, {no_of_theatres}\n")
total_records_copied += 1
except FileNotFoundError:
print(f"File '{input_filename}' not found.")
except Exception as e:
print(f"An error occurred: {e)

return total_records_copied
input_file = "CINEMA.DAT"
output_file = "CINEMA_COPY.DAT"
records_copied = copy(input_file, output_file)
print(f"Total records copied: {records_copied}")

creating the function - ½ mark


import of pickle module – ½ mark
Opening the file with correct mode – ½ mark
Displaying total number of records- ½ mark
logic – 1 mark
(Mark can be awarded to any program that does the Push and pop operation of a
stack)
(OR)
i) seek():
• used to set the file cursor to the specific position.
• Takes two parameters : the first offset and the second is position

7
• By using seek() method, we can manipulate the reading position of the file’s
content
tell():
• used to return the position of the file cursor
• takes no parameter
• by using tell() method, we can get only the position of the file cursor.

ii)
import pickle
def findType(mtype):
try:

with open("CINEMA.DAT", "rb") as file:


data = pickle.load(file)
for mno, movie_data in data.items():
_, _, movie_type = movie_data
if movie_type == mtype:
print(f"MNO: {mno}, MNAME: {movie_data[0]}, MTYPE: {movie_type}")
except FileNotFoundError:
print("CINEMA.DAT file not found.")
except Exception as e:
print(f"An error occurred: {e}")

# Example usage:
mtype_to_find = "Action"
findType(mtype_to_find)

creating the function - ½ mark


import of pickle module – ½ mark
Opening the file with correct mode – ½ mark
Displaying the searched record- ½ mark
logic – 1 mark
(Mark can be awarded to any program that does the Push and pop operation of a
stack)
35 a) 1005 2+3
12
b)
mycursor=con1.cursor()
mycursor.execute(querry)
con1.commit()

8
(OR)
a) c&&vVpP
b)
mycursor=con1.cursor()
mycursor.execute(“select * from student where marks>90”)
mycursor.fetchall()

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