Practical Question, CS-2024 PDF Computer Programming Computing
Practical Question, CS-2024 PDF Computer Programming Computing
Document Information
This document contains a sample question paper for t…
Original Description:
Download now
Hii Yyujjhgbnnbbvbnnk
Download as docx, pdf, or txt
Original Title
PRACTICAL QUESTION, CS-2024
AISSCE EXAMINATION – 2024
Copyright Practical Question Paper (Set-1)
School No-
© © All Rights Reserved Date:
given below:
Facebook
Q – 2 Write the SQL queries (a) to (d) based on the relations SENDER and RECIPENT
Twitter
[1*4=4]
a) Display all sender names those who are belongs from the city Mumbai.
Is this content
b) Display inappropriate?
recID, SenderName, SenderAddress & Recipient City belonging from the tables.
c) Display the records of recipient table in ascending order based on RecID.
d) Display the no of recipient and city name from each city.
Report
Q – 3 Practical Report File 7
Q – 4 Project 8
Q –5 Viva Voce 3
PYTHON CODE
Q1(A). Write a function in Python that counts the number of “Me” or “My” (in smaller
case also) words present in a text file.
# SOURCE CODE
def displayMeMy():
num=0
f=open("Mydoc4.txt","r")
N=f.read()
M=N.split()
for x in M:
if x=="Me" or x== "My":
print(x)
num=num+1
print("Count of Me/My in file:",num)
f.close()
filein = open("Mydoc4.txt",'w')
str=" "
n=int(input("enter the no of lines you want to write in a file"))
for k in range(n):
str =input("enter a line")
filein.write(str)
filein.write("\n")
filein.close()
displayMeMy()
# OUTPUT
enter the no of lines you want to write in a file2
enter a lineMe Mee My MMy Myy
enter a lineeMe Me Myy My YMy
Me
My
Me
My
Count of Me/My in file: 4
Q1(B) Write a program to create a binary file to write 10 integers, read the file and display
the sum of even integers.
#SOURCE CODE
def accept_integer(file1):
import pickle
obj=open("file1","wb")
k=0
for k in range(10):
num=eval(input("enter an integer"))
pickle.dump(num,obj)
Page 2
Learn More
obj.close()
def read_integer(file1):
import pickle
obj=open("file1","rb")
val=0
try:
while True:
num=pickle.load(obj)
if num%2==0:
val+=num
except EOFError :
pass
obj.close()
#OUTPUT
Enter binary file namekk
enter an integer11
enter an integer23
enter an integer5
enter an integer4
enter an integer9
enter an integer7
enter an integer8
enter an integer12
enter an integer22
enter an integer13
Data has been written into binary file
---------------------------------------
Sum of all even numbers is 46
Page 3
Cancel Anytime
Document 53 pages
Document 34 pages
Document 19 pages
Document 28 pages
Document 6 pages
Document 8 pages
Document 31 pages
Document 7 pages
Document 1 page
Document 10 pages
Document 2 pages
Document 11 pages
Show more
About Support
Press AdChoices
Twitter
Legal Facebook
Terms Pinterest
Privacy
Copyright
Cookie Preferences
Documents
Language: English
Download