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

Computer Record Questions

Uploaded by

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

Computer Record Questions

Uploaded by

shauntomsajan748
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Toc H Public School, Vyttila

COMPUTER SCIENCE (083)


CLASS 12 RECORD QUESTIONS 2025 – 2026
------------------------------------------------------------------------------------------------------------
1. Write a Python function that passes an integer N as argument and displays the factorial of
that number.
2. Write a Python program implementing user defined function PALLINDROME() that accepts a
string as argument and return 1 if the string is palindrome else return -1.
3. Write a Python function that returns all the unique numbers in a list L that is passed as
argument to the user defined function FINDNUM(L).
4. Write a Python program that accepts a tuple NUM as argument and returns and display all
the numbers that ends with 3.
5. Write a function dispCars(CARS) in Python that takes a dictionary CARS as an argument and
displays the names in uppercase of those cars whose names start with the letter “M”.
Structure of the dictionary is {IDNo : Car Name , Company}
6. Create a Python program to simulate rolling of two dice that generate random numbers
between 1 and 6 and print the total of the two numbers generated.
7. Create a text file named [Link] to store n lines of text. Write a function COUNTST() that
counts and displays the occurrences of the letters 'S' and 'T' (both uppercase and
lowercase).
8. Create a text file named [Link] to store n lines of text. Write a function DISPWORDS()
that displays all the words that start and end with a vowel.
9. Create a text file named [Link] to store n lines of text. Write a function that displays
all the lines that start with the word “What.”
10. Create a text file named [Link] to store n lines of text. Write a function that displays all
the lines containing the word “was.”
11. A binary file named [Link] stores cake records in the form of a dictionary:
{'cake_id': int, 'cake_name': str, 'price': float}.

Write a Python function searchCake(cake_id) that Searches for a cake with the given
cake_id, and displays its name and price if found, Otherwise, displays "Cake not found."

12. Store the information of three participants in a binary file named [Link] in the following
format: [Participant, Age, Event]. Write a function that reads the contents from [Link]
and creates a file named [Link], copying only those records where the event name is
“Athletics.”
13. A binary file named [Link] contains book records in the form of a list
[book_id, title, author].

Write a Python function deleteBook(book_id) that deletes the record that matches the
given book_id and displays appropriate message indicating whether the deletion was
successful or if the book was not found.

Page 1 of 5
14. Create a Python program that performs the following using user-defined functions:

(i) Add_Movie() – This function should prompt the user to input the details of a movie:

a. MNO (Movie Number)


b. MNAME (Movie Name)
c. MTYPE (Movie Type)

The function should then append these details as a list to a CSV file named
[Link].

(ii) findType(mtype) – This function should accept a movie type (mtype) as a parameter
and display all records from [Link] that match the given type.

15. A list named Customer contains n customer records, where each record is in the format:
[Customer_name, Room_Type].

Write user-defined functions to perform the following operations on a stack named Hotel:

(i) Push_Cust(Customer) – This function should push the names of customers into the stack
if their Room Type is 'Delux'.
(ii) Pop_Cust() – This function should pop and display the names of customers from the
stack. If the stack is empty, display 'Underflow'.

16. Implement a stack-based application in Python to manage stationary items. Each item is
represented as a dictionary in the format {Sname: price,Qty}.
(i) Write a function named Push(SItem) that performs the following:
Push the name of each item into the stack only if its price is greater than 75. Also
display the total number of items successfully pushed into the stack

(ii) Write a function Pop() that pops the names and display the names popped from
the stack.

17. Write a Python program to create a database – Bank and create a table
with the following details:
User Name - root
Password - toch
Name of the table - Customer

• The attributes of Customer are as follows:

AccNo – integer which is a Primary key,


CustName – character of size 20 which should not be null,
Type – Character of size 5 which store the account type as ‘S’ for Savings, ‘C’
for current account.
Amount – integer

Page 2 of 5
Display the message “Table Created” after creating the table.

(a) Add 4 records to the table.

AccNo CustName Type Amount


1267 Pradeep Nair S 25000
1500 Dania Suhaid S 40000
2003 Harris F C 55050
1988 Marcus Simon C 72000

18. Write a Python program to do the following using the table ‘Customer’.
(a) Display data of all customers whose Account type is ‘S’.
(b) Change the amount of AccNo 1500 to 30000.

19. Write a Python program to do the following using the table ‘Customer’.
(a) Display the names of Customers in ascending order of AccNo.
(b) Display the details of customers whose amount is greater than 50000.

20. Write a Python program to delete the record whose Type is “C”
and display the remaining records in the table Customer

Page 3 of 5
STRUCTURED QUERY LANGUAGE

Give the SQL command with output for the following questions based on the given tables
‘Games’ and ‘Player’

TABLE : GAMES

Gcode Gamename Type No_team Prizemoney SchDate


101 Carom Board Indoor 2 5000 2025-01-21
102 Badminton Outdoor 2 12000 2024-12-28
103 Table Tennis Indoor 4 9000 2025-02-10
105 Chess Indoor 2 10000 2025-01-02
108 Lawn Tennis Outdoor 4 15000 2024-12-30
110 Cricket Outdoor 11 25000 NULL

TABLE : PLAYER

P_No Pname Gcode


P1011 Kunal Singh 110
P1014 Thanvi P 103
P1015 Vishnu Dev 102
Aman
P1020 Mohammed 110
P1023 Anil Mathew 110

1. Create a database ‘Class12’


2. Create a table ‘GAMES’ with the following specifications:
Field datatype Constraint description
Gcode int Primary key Game Code
Gamename varchar(15) not null Game Name
Type varchar(8) Type of Game
No_team int Default value 2 No of players per team
Prizemoney int Prize money
Schdate date Schedule date

3. Display the structure of the table GAMES


4. Add a record with the given data to the table GAMES
110, Cricket, Outdoor, 11, 25000, NULL

Page 4 of 5
5. Display all the records of the table GAMES
6. Display the columns Gamename , Prizemoney where the number of players is less than
4.
7. Display the type of the games without repetition.
8. Display Gcode, Schedule date of games whose game name is either Carom Board
Table Tennis or Chess.
9. Display Pno and Pname of all players from the table in descending order of names.
10. Display all the details of the game whose schedule date is NULL.
11. Display the minimum and maximum prizemoney. Also Sum of prize money whose Type
is Outdoor.
12. Display the sum of prize money of games of each type.
13. Display the Gamename whose name starts with ‘C’.
14. Display Gcode, Gamename, SchDate, P_No, Pname of players who are playing indoor
games (use equi join)
15. Display Gcode, Gamename, SchDate, Pname of players who are playing outdoor games.
(use natural join)
16. Add a Column DOB of datatype date to the table Player and initialize the column with
the date ‘2005-01-01’
17. Change the DOB of Player ‘P115’ to ‘2006-10-12’
18. Delete the records from the table “Player”
19. Delete the table Player.
20. Delete the database Class12.

x -------------------------------------------------- x

Page 5 of 5

You might also like