0% found this document useful (0 votes)
7 views5 pages

Computer Science Practical Exam 2023-24

The document outlines the practical examination for Computer Science (083) for the All India Senior School Certificate Examination 2023-24, detailing tasks such as writing a Python program to implement a stack and SQL queries for a stock table. It includes specific programming tasks, a practical report, a project, and a viva voce component. The provided solution includes a Python implementation of stack operations and SQL query requirements.
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)
7 views5 pages

Computer Science Practical Exam 2023-24

The document outlines the practical examination for Computer Science (083) for the All India Senior School Certificate Examination 2023-24, detailing tasks such as writing a Python program to implement a stack and SQL queries for a stock table. It includes specific programming tasks, a practical report, a project, and a viva voce component. The provided solution includes a Python implementation of stack operations and SQL query requirements.
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

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.

You might also like