0% found this document useful (0 votes)
50 views

Final File 1

The document is a computer science project report submitted by two students, Manan Bansal and Madhav, to their teacher Mr. Amit Singhal. It contains the certificate of completion, acknowledgements, and an index of 18 Python programs. The programs cover topics like calculating electricity bills based on units consumed, a menu to calculate area of shapes, functions to check prime numbers and palindrome strings, and operations on lists, stacks, dictionaries and files.
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)
50 views

Final File 1

The document is a computer science project report submitted by two students, Manan Bansal and Madhav, to their teacher Mr. Amit Singhal. It contains the certificate of completion, acknowledgements, and an index of 18 Python programs. The programs cover topics like calculating electricity bills based on units consumed, a menu to calculate area of shapes, functions to check prime numbers and palindrome strings, and operations on lists, stacks, dictionaries and files.
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
You are on page 1/ 43

CH.

CHHABIL
Children's AcademyDASS
Ghaziabad
PUBLIC SCHOOL

COMPUTER SCIENCE
PROJECT REPORT ON
COMPUTER
SHOE BILLING
SCIENCE PROGAM FILE

Submitted By: Submitted To:


Manan Bansal and Madhav
Devansh,Shivam Mr.Mrs.
AmitDeepika
Singhal
XII-E (CS faculty)
Roll No.-

1|Page
CERTIFICATE OF COMPLETION

This is to certify that Devansh,Shivam


Manan Bansal ofandclass XII-E has
Madhav
completed his computer science program file under
the guidance of Mr. Amit
Mrs. Singhal for the academic year
Deepika
2023-2024. The certified student has been dedicated
throughout his research and completed his work
before the given deadline without missing any
important details from the project. It is also certified
that this project is the individual work of the student
and can be submitted for evaluation.

Teacher’s signature

2|Page
Acknowledgement

Firstly, I would like to thank our computer teacher Mr.


Amit Singhal, because he always supported and guided
us while doing this project. He very well cleared all the
doubts I had regarding this project. Also, I would like to
especially thank my parents and friends who helped me
a lot to complete this project within the limited time.

The journey of making this project has been beautiful, as


well as knowledgeable for me and I have learned a lot
from it.

Once again, thanks to everyone who was involved with


this project from beginning to end.

3|Page
Index

S no. Topic Page no.

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

records of its employees. Develop an interface that provides front-end


interaction through Python, and stores and updates records using MySQL.
The operations on MySQL table “emp” involve reading, searching, updating
and deleting the records of employees.

(a) Program to read and fetch all the records from EMP table having salary
more than 7000.

(b) Program to update the records of employees by increasing salary by


1000 of all those employees who are getting less than 80000.

(c) Program to delete the record on the basis of inputted salary.

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’

ANSWERS: (i) SELECT * from EMPLOYEE order by DOJ desc;


(ii) SELECT name, desig from EMPLOYEE where SGRADE=S02 or SGRADE=S03;
(iii) SELECT * from EMPLOYEE where DOJ between ‘09-Feb-2006’ and ‘08-Aug-2009’;
(iv) INSERT into EMPLOYEE values (109, ‘Harish Roy’, ‘HEAD-IT’, ‘S02’, ‘9-Sep-2007’, ‘21-Apr-
1983’);

(b) Give the output of the following SQL queries:

37 | P a g e
(i) SELECT COUNT(SGRADE), SGRADE FROM EMPLOYEE GROUP BY SGRADE;

(ii) SELECT MIN(DOB), MAX(DOJ) FROM EMPLOYEE;

(iii) SELECT SGRADE, SALARY+HRA FROM SALGRADE WHERE SGRADE =’S02’;

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;

ANSWERS: (i) SELECT Pname,Quantity,Rate from ORDERS where Pname=’Pen’


or Pname=’Pencil’;
(ii) SELECT * from ORDERS where Discount is NULL;
(iii) SELECT Pname,Quantity,Sale_date from ORDERS where Quantity*Rate
‘Total cost’>500;
(iv) SELECT * from ORDERS where Rate between 20 and 100;
(v)

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.

ANSWERS: (i) SELECT Book_name from BOOKS where Publishers=’FIRST


PUBL.’ or author_name=’P. Purohit’;
(ii) SELECT Price*qty ‘Cost’ from BOOKS where Publishers=’FIRST PUBL.’;
(iii) UPDATE BOOKS set price = price* 0.95 where Publishers=’EPB’;
(iv) SELECT Book_Name, Price FROM Books WHERE Copies_issued > 3;
(v) SELECT Type, SUM(Price) AS Total_Cost FROM Books GROUP BY Type;
(vi) SELECT * FROM Books ORDER BY Price DESC LIMIT 1;

Q4. Consider the given table and answer the questions.


40 | P a g e
(i) To show all information of students where capacity is more than the no. of students in
order of rtno.
(ii) To show area_covered for buses covering more than 20 km., but charges less than 80000.
(iii) To show transporter-wise total no. of students travelling.
(iv) To show rtno, area_covered and average cost per student for all routes where average
cost per student is—charges/noofstudents.
(v) Add a new record with the following data:
(11, “Motibagh”,35,32,10, “kisan tours”, 35000)
(vi) Give the output considering the original relation as given:
(a) select sum(distance) from schoolbus where transporter= “Yadav travels”;
(b) select min(noofstudents) from schoolbus;
(c) select avg(charges) from schoolbus where transporter= “Anand travels”;
(d) select distinct transporter from schoolbus;

ANSWERS: (i) SELECT * FROM schoolbus WHERE noofstudents < capacity


ORDER BY rtno;
(ii) SELECT area_covered FROM schoolbus WHERE distance > 20 AND charges <
80000;
(iii) SELECT transporter, SUM (noofstudents) AS total_students FROM
schoolbus GROUP BY transporter;
(iv) SELECT rtno, area_covered, charges / noofstudents AS
avg_cost_per_student

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

1. NCERT Computer Science


2. Python IDLE 64bits
3. MySQL
4. Google Chrome

43 | P a g e

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy