0% found this document useful (0 votes)
6 views2 pages

Class XII Computer Science Sample Paper

This document is a sample paper for Class XII Computer Science focusing on file handling with binary files and stack operations. It outlines tasks for managing employee records and product details through user-defined functions in Python. The paper includes specific functions for adding, displaying, and modifying records for employees and products, along with their respective requirements.

Uploaded by

saravanannikkita
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)
6 views2 pages

Class XII Computer Science Sample Paper

This document is a sample paper for Class XII Computer Science focusing on file handling with binary files and stack operations. It outlines tasks for managing employee records and product details through user-defined functions in Python. The paper includes specific functions for adding, displaying, and modifying records for employees and products, along with their respective requirements.

Uploaded by

saravanannikkita
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

Class XII Computer Science – Sample Paper – 3

File Handling – Binary Files & Stack


Date: 28/11/2025 Time: 1 Hour Max Marks: 25

1. You have a stack named EMPSTACK that contains records of employees in a


list format. Each employee record is represented as a list containing

[ECode, EName, Dept, Salary].

Sample Employee Record is [“D0894”, ”Uday”, ”Sales”, 29500]

Write the following user-defined functions in Python to perform the specified


operations on the stack EMPSTACK: (5)

(I) PUSHEMP(EMPSTACK): This function takes the stack EMPSTACK as


arguments and pushes the new employee record onto the stack.
(II) POPEMP( EMPSTACK): This function pops the topmost employee record from
the stack and returns it. If the stack is already empty, the function should display
"Employee Records are not found! Underflow! ".
(III) PEEK(EMPSTACK): This function displays the topmost element of the stack
without deleting it. If the stack is empty, the function should display "Employee
Records are not available to display".

2. Mr. Karthik is a Corporate manager working in Power House Pvt. Limited at


Bhopal. He needs to manage the records of all the employees in a binary file
“[Link]”. For this, He wants the following information of each employee who are
working in the company: [EmpNo, EmpName, Department, JoinDate, Salary] (10)
EmpNo – integer (Employee No.)
EmpName – string (Employee Name)
Dept – string (Department)
JoinDate – string (Date of Join)
Salary – float (Salary Amount)

You, as an application programmer of the company, have been assigned to do the


following tasks for Mr. Karthik.
(I) Write a function NewEmployee() to input the new employee details who have
joined recently and append it in the binary file.
(II) Write a function ShowEmployees() to read and display details of all those
employees whose salary is less than Rs. 60,000.
(III) Write a function ViewEmployees() to read and display details of all those
employees who are working in “Marketing”.
(IV) Write a function RemoveEmployees() to remove the details of an employees
who are working in “Inventory” department.
(V) Write a function ChangeSalary() to increase the salary by Rs. 10,000 for an
employee whose employee number was inputted by the user.

3. Mr. Rajan is a administrative supervisor working in a leading Mixie


manufacturing company at Jaipur. He wants to maintain the details of various types
of mixie products. For this he wants the following information of each product
which are ready for sales: (10)
ProdCode – integer (Product Code)
ProdName – string (Product Name)
JarType – string (Jar Type – Single / Double / Triple)
Capacity - float (Jar Capacity – 1 / 1.5 / 2 – In litres)
Voltage - int (Voltage requirements)
Rate - float (Mixie product Rate)

You, as a lead programmer of the company, have been assigned to do the following
tasks for Mr. Rajan:
(I) Write a function AppendProducts() to input the details of new product and add it
to the binary file.
(II) Write a function ShowProductDetails() to read and display details of all those
products with product rate is more than Rs. 15,000.
(III) Write a function ViewProduct() to read and display details of all those products
with Jar Type “Double”.
(IV) Write a function DelProducts() to remove the details of all products of “Single”
Jar Type.
(V) Write a function ModifyRate() to decrease the rate by Rs. 2,000 for the products
in which product code was inputted by the user.

All the Best

You might also like