Final File 1
Final File 1
CHHABIL
Children's AcademyDASS
Ghaziabad
PUBLIC SCHOOL
COMPUTER SCIENCE
PROJECT REPORT ON
COMPUTER
SHOE BILLING
SCIENCE PROGAM FILE
1|Page
CERTIFICATE OF COMPLETION
Teacher’s signature
2|Page
Acknowledgement
3|Page
Index
4|Page
About Python
Python, a high-level programming language, has emerged as a
preferred choice for a myriad of projects, showcasing its adaptability
and versatility across diverse domains. In the context of developing a
digital library, Python's attributes play a pivotal role in streamlining the
project's implementation and ensuring efficiency throughout the
development life cycle. One of Python's standout features is its
simplicity and readability. Python's syntax is clear and concise, making
it accessible for beginners and conducive to rapid development. This
simplicity not only accelerates the learning curve but also facilitates
collaboration among developers, as codebases are more
comprehensible and maintainable. The language's readability is a
testament to the "Zen of Python" philosophy, emphasizing the
importance of clarity and simplicity in code. Python's extensive
ecosystem and rich libraries further contribute to its appeal. The
language boasts a vast collection of libraries and frameworks that
cater to diverse requirements. In the case of a digital library project,
Python's web development frameworks, such as Flask and Django,
provide robust tools for building scalable and feature-rich
applications. These frameworks expedite the development process by
offering pre-built components and adhering to best practices.
Database integration is seamless in Python, with support for various
databases. Libraries like SQL Alchemy simplify database interactions,
allowing developers to perform CRUD operations effortlessly. For a
digital library project, effective database management is crucial, and
Python's capabilities in this area enhance the project's data storage
and retrieval mechanisms.
Python's cross-platform compatibility is advantageous for digital
library projects that may need to run on various operating systems.
This characteristic enhances deployment flexibility and simplifies the
scaling process, allowing the project to adapt to changing
5|Page
requirements. In summary, Python's versatility, readability, rich
ecosystem, and community support position it as an ideal choice for
digital library projects. Whether it involves web development,
database integration, or API creation, Python's capabilities streamline
the development process, fostering efficient and effective
implementation. The language's attributes make it not only a pragmatic
choice for current projects but also a future-proof investment in the
evolving landscape of technology and software.
6|Page
Python Index
7|Page
8|Page
Program-1:
WAP to input total units which was consumed by a customer, calculate and display
total charged to be paid by the customer. Electric Bill charges will calculate
as per following condition.
No. of units Rate(in Rs)
First 100 Units 1 Rs per unit.
Next200 Units 2 Rs per unit.
Above300 Units 4 Rs per unit.
Output:
9|Page
Program-2: Write a menu driven program to calculate:
Area of circle [A=πr2]
Area of square
[A=a*a]
Area of rectangle
[A=l*b]
Output:
10 | P a g e
Program-3: Write a UDF in python, it will take a number as a function argument.
Function check and display whether the number if prime or not.
Output:
11 | P a g e
Program-4: Write a UDF in python, it will take a number as a function argument.
Function calculates and display sum of each digit of that given number.
For example: number is 456, Sum is 4+5+6= 15
Output:
12 | P a g e
Program-5: Write a program in python, count and display the number of vowels,
consonants, uppercase, lowercase characters in string.
Output:
13 | P a g e
Program-6: Write a UDF in python, it will take three arguments list (sequence of
elements), its size and finding element. Function search and return 1 if
element is present in the given list otherwise return -1. Using Binary search.
Output:
14 | P a g e
Program-7: Write a program in python, to input a string check and display
given string is a palindrome or not.
Output:
15 | P a g e
Program-8: Write a program in python, to create a number list. Search and
display largest and smallest number present in a list. Without using built-in
function.
Output:
16 | P a g e
Program-9: Write a program in python, to create a number list. Calculate and
display sum of those elements whose last digit is 5.
Output:
17 | P a g e
Program-10: Write a program in python, to create two number lists a and b.
Swap and display all elements of both lists.
18 | P a g e
Program-11: Write a UDF in python, it will take a list as a function argument.
Replace and display first half elements with second half elements of a list.
19 | P a g e
Program-12: Write a function in PYTHON that counts the number of “Me” or
“My” words present in a text file “DIARY.TXT”.
My first book was Me and My
Family. It gave me chance to be
Known to the world.
Output:
20 | P a g e
Program-13: Write a function in PYTHON to read the contents of a text file
“Places.Txt” and display all those lines on screen which are either starting
with ‘P’ or with ‘S’.
Output:
21 | P a g e
Program-14: Write a function EUCount () in PYTHON, which should read each
character of a text file IMP.TXT, should count and display the occurrences
of alphabets E and U (including small cases e and u too).
Output:
22 | P a g e
Program-15: Write a function in PYTHON to search for a BookNo from a
binary file “BOOK.DAT”, assuming the binary file is containing the records
of the following type: ("BookNo", "Book name"). Assume that BookNo is an
integer.
Output:
23 | P a g e
Program-16: Write a function in Python for PushS(List) and for PopS(List) for
performing Push and Pop operations with a stack of List containing integers.
24 | P a g e
Program-17: Write a menu-driven program implementing user-defined
functions to perform different functions on a csv file “student” such as:
(a) Write a single record to csv.
(b) Write all the records in one single go onto the csv.
25 | P a g e
(c) Display the contents of the csv file.
Output:
26 | P a g e
27 | P a g e
Program-18: Write a menu-driven program to perform all the basic
operations using dictionary on student binary file such as inserting, reading,
updating, searching and deleting a record.
28 | P a g e
29 | P a g e
Output:
30 | P a g e
Program-19: .Write a program to create a stack called student, to
perform the basic operations on stack using list. The list contains two data values
called roll number and name of student. Notice that the data manipulation
operations are performed as per the rules of a stack.
31 | P a g e
32 | P a g e
Program-20: ABC Infotech Pvt. Ltd. needs to store, retrieve and delete the
(a) Program to read and fetch all the records from EMP table having salary
more than 7000.
33 | P a g e
About SQL
MySQL is a relational database management system (RDBMS) that
plays a significant role in organizing and managing data in various
software applications. In the context of Class 12th computer science,
students can explore fundamental concepts related to databases and
their practical implementation using MySQL.
Key Concepts: -
Database: - A database is a structured collection of data. MySQL allows
users to create, manage, and manipulate databases efficiently.
Students learn how to design databases to store information in an
organized manner.
Tables: - Databases consist of tables, which are essentially grids
where data is stored. Each table has columns (representing attributes)
and rows (representing records). This concept helps in organizing
different types of data systematically.
SQL (Structured Query Language): - SQL is the language used to
interact with MySQL databases. It enables users to perform operations
like inserting, updating, and retrieving data from tables. Understanding
basic SQL commands is an essential part of learning MySQL.
Primary Keys: - Primary keys uniquely identify each record in a table.
Students understand the importance of primary keys in maintaining
data integrity and uniqueness.
Data Types: - MySQL supports various data types, such as integers,
strings, and dates. Students learn how to choose appropriate data
types for different types of information.
Practical Implementation: -
34 | P a g e
Creating a Database: - Students learn how to create a MySQL database
using SQL commands. This involves defining the database name,
tables, and their structures.
Inserting and Retrieving Data: - Practical exercises involve inserting
data into tables and retrieving specific information using SQL queries.
This hands-on experience enhances students' understanding of
database operations.
Updating and Deleting Records: - Understanding how to update and
delete records in a database is a crucial aspect. Students learn to
modify existing data efficiently.
Normalization: - Normalization is the process of organizing data to
reduce redundancy and improve data integrity. Students grasp the
basics of normalization to design efficient databases.
Queries and Reports: - Introduction to generating complex queries and
reports allows students to extract meaningful information from
databases.
Application in Real Life: - Students can relate the concepts of MySQL to
real-life scenarios. For instance, understanding how e-commerce
websites manage inventory, track orders, and store customer
information using databases can provide practical insights into the
application of MySQL in the business world.
SQL Index
35 | P a g e
Q1. Consider the tables EMPLOYEE and SALGRADE given below and answer (a)
and (b) parts of this question.
36 | P a g e
(a) Write SQL commands for the following statements:
(i) To display the details of all EMPLOYEEs in descending order of DOJ.
(ii) To display NAME and DESIG of those EMPLOYEEs whose SALGRADE is either S02 or S03.
(iii) To display the content of the entire EMPLOYEEs table, whose DOJ is in between ‘09-Feb-
2006’ and ‘08-Aug-2009’.
(iv) To add a new row with the following content:
109, ‘Harish Roy’, ‘HEAD-IT’, ‘S02’, ‘9-Sep-2007’, ‘21-Apr-1983’
37 | P a g e
(i) SELECT COUNT(SGRADE), SGRADE FROM EMPLOYEE GROUP BY SGRADE;
ANSWERS: (i)
(ii)
(iii)
Q2. Study the following table and write SQL queries for questions (i) to (iv) and output for (v)
and (vi).
38 | P a g e
(i) Write SQL query to display Pname, Quantity and Rate for all the orders that
are either Pencil or Pen.
(ii) Write SQL query to display the orders which are not getting any Discount.
(iii) Write SQL query to display the Pname, Quantity and Sale_date for all the
orders whose total cost (Quantity * Rate) is greater than 500.
(iv) Write SQL query to display the orders whose Rate is in the range 20 to 100.
(v) SELECT Pname, Quantity from Orders WHERE Pname LIKE(‘_e%’);
(vi) SELECT Pname, Quantity, Rate FROM Orders Order BY Quantity DESC;
Q3. Write SQL commands for (i) to (vi) on the basis of relations given below:
39 | P a g e
(i) To show the books of FIRST PUBL. Publishers written by P. Purohit.
(ii) To display cost of all the books published for FIRST PUBL.
(iii) Depreciate the price of all books of EPB publishers by 5%.
(iv) To display the BOOK_NAME and price of the books, more than 3 copies of which have been
issued.
(v) To show total cost of books of each type.
(vi) To show the details of the costliest book.
41 | P a g e
FROM schoolbus;
(v) INSERT INTO schoolbus (rtno, area_covered, distance, noofstudents,
charges, transporter) VALUES (11, 'Motibagh', 35, 32, 10000, 'kisan tours');
(vi) (a)
(b)
(c)
(d)
42 | P a g e
Bibliography
43 | P a g e