All India Senior School Certificate Examination 2023-24
Practical Examination - Computer Science (083)
SET 2
Time: 3:00 Hours Max. Marks: 30
Q 1. a) Write a menu drive program in python to implement stack using a list and
perform following functions: 8
1. Push
2. Pop
3. Display
4. Peek
b) Consider the table given below and write the sql queries based on the table data 4
Table Name : stock
a. Display all the items in the ascending order of stockdate.
b. Display maximum price of items for each dealer individually as per dcode from stock.
c. Display average price of items for each dealer individually as per dcode from stock which average
price is more than 5.
d. Display item details which don’t contain the letter ‘P’ in it.
Q2. Practical Report File 7
Q3. Project 8
Q4. Viva Voce 3
Solution:
stk=[]
top=-1
def isEmpty():
global top
if stk==[]:
print("Stack is Empty")
else:
None
def push():
global top
n=int(input("Enter value to append:"))
[Link](n)
top=len(stk)-1
print("Value is Pushed into stack.")
def display():
global top
if top==-1:
isEmpty()
else:
top=len(stk)-1
print("Top->",stk[top])
for i in range(top-1,-1,-1):
print(stk[i])
def Pop():
global top
if top==-1:
isEmpty()
else:
print("Elment Popped:",[Link]())
top=top-1
def peek():
global top
if stk==[]:
print("Stack Empty")
else:
top=len(stk)-1
print("Peeked Element:",stk[top])
def menu():
while True:
print('''
1. Push
2. Pop
3. Display
4. Peek
5. Exit
''')
ch=int(input("Enter any number:"))
if ch==1:
push()
elif ch==2:
Pop()
elif ch==3:
display()
elif ch==4:
peek()
elif ch==5:
print("Bye Bye!")
break
else:
print("Invalid choice")
menu()
SQL :
a. Display all the items in the ascending order of stockdate.
b. Display maximum price of items for each dealer individually as per dcode from stock.
c. Display average price of items for each dealer individually as per dcode from stock which average
price is more than 5.
d) Display item details which don’t contain the letter ‘P’ in it.