Gauss Law and It's Application
Gauss Law and It's Application
SUBMITTED BY:
HARIPRASATH.B Roll Number-
UNDER THE SUPERVISION AND GUIDANCE of
Mr. Raja raja cholan
1
DEPARTMENT OF COMPUTER SCIENCE
CERTIFICATE
The project report entitled : LIBRARY MANAGEMENT
Submitted by:
HARIPRASATH.B
of grade XII for the XI CBSE Senior Secondary Examination Class XII of COMPUTER SCIENCE at
2
TABLE OF CONTENTS [ T O C ]
3
SER DESCRIPTION PAGE NO
01 ACKNOWLEDGEMENT 04
02 INTRODUCTION 05
04 PROPOSED SYSTEM 06
06 SOFTWARE DESCRIPTION 08
10 MODULES 17
11 SOURCE CODE 18
12 27
OUTPUT and TESTING
14 BIBLIOGRAPHY 32
ACKNOWLEDGEMENT
4
Apart from the efforts of me, the success of any project
depends largely on the encouragement and guidelines of many
others. I take this opportunity to express my gratitude to the
people who have been instrumental in the successful completion
of this project.
HARIPRASATH.B
5
INTRODUCTION
This project is all about software for library. It helps the Book Stall Owner to have
a full-fledged control over his/her stall. It adds a new stock, updates an existing stock
and of course prints a receipt to the customer. Besides it displays a graph of the sales
The objective of this project is to let the students apply the programming
knowledge into a real- world situation/problem and exposed the students how
PROPOSED SYSTEM
6
Today one cannot afford to rely on the fallible human beings of be really wants to
stand against today’s merciless competition where not to wise saying “to err is
human” no longer valid, it’s outdated to rationalize your mistake. So, to keep pace with
time, to bring about the best result without malfunctioning and greater efficiency so to
replace the unending heaps of flies with a much sophisticated hard disk of the
computer.
One has to use the data management software. Software has been an ascent in
atomization various organizations. Many software products working are now in markets,
which have helped in making the organizations work easier and efficiently. Data
management initially had to maintain a lot of ledgers and a lot of paper work has to be
done but now software product on this organization has made their work faster and
easier. Now only this software has to be loaded on the computer and work can be done.
This prevents a lot of time and money. The work becomes fully automated and
any information regarding the organization can be obtained by clicking the button.
Moreover, now it’s an age of computers of and automating such an organization gives
7
SYSTEM DEVELOPMENT LIFE CYCLE (SDLC)
8
LIBRARIES FILES AND THEIR USES:
1. Scrapy
One of the most popular Python data science libraries, Scrapy helps to build crawling
programs (spider bots) that can retrieve structured data from the web – for example,
URLs or contact info. It's a great tool for scraping data used in, for example, Python
machine learning models.
2. BeautifulSoup
BeautifulSoup is another really popular library for web crawling and data scraping. If you
want to collect data that’s available on some website but not via a proper CSV or API,
BeautifulSoup can help you scrape it and arrange it into the format you need.
3. NumPy
NumPy (Numerical Python) is a perfect tool for scientific computing and performing
basic and advanced array operations.
The library offers many handy features performing operations on n-arrays and matrices
in Python. It helps to process arrays that store values of the same data type and makes
performing math operations on arrays (and their vectorization) easier.
4. SciPy
This useful library includes modules for linear algebra, integration, optimization, and
statistics. Its main functionality was built upon NumPy, so its arrays make use of this
library. SciPy works great for all kinds of scientific programming projects (science,
mathematics, and engineering). It offers efficient numerical routines such as numerical
optimization, integration, and others in submodules. The extensive documentation
makes working with this library really easy.
9
5. Pandas
Pandas is a library created to help developers work with "labeled" and "relational" data
intuitively. It's based on two main data structures: "Series" (one-dimensional, like a list
of items) and "Data Frames" (two-dimensional, like a table with multiple columns).
Pandas allows converting data structures to DataFrame objects, handling missing data,
and adding/deleting columns from DataFrame, imputing missing files, and plotting data
with histogram or plot box. It’s a must-have for data wrangling, manipulation, and
visualization.
6. Keras
Keras is a great library for building neural networks and modeling. It's very
straightforward to use and provides developers with a good degree of extensibility. The
library takes advantage of other packages, (Theano or TensorFlow) as its backends.
Moreover, Microsoft integrated CNTK (Microsoft Cognitive Toolkit) to serve as another
backend. It's a great pick if you want to experiment quickly using compact systems – the
minimalist approach to design really pays off!
7. SciKit-Learn
This is an industry-standard for data science projects based in Python. Scikits is a group
of packages in the SciPy Stack that were created for specific functionalities – for
example, image processing. Scikit-learn uses the math operations of SciPy to expose a
concise interface to the most common machine learning algorithms.
8. PyTorch
PyTorch is a framework that is perfect for data scientists who want to perform deep
learning tasks easily. The tool allows performing tensor computations with GPU
acceleration. It's also used for other tasks – for example, for creating dynamic
computational graphs and calculating gradients automatically. PyTorch is based on
Torch, which is an open-source deep learning library implemented in C, with a wrapper
in Lua.
10
9. TensorFlow
TensorFlow is a popular Python framework for machine learning and deep learning,
which was developed at Google Brain. It's the best tool for tasks like object
identification, speech recognition, and many others. It helps in working with artificial
neural networks that need to handle multiple data sets. The library includes various
layer-helpers (tflearn, tf-slim, skflow), which make it even more functional. TensorFlow
is constantly expanded with its new releases – including fixes in potential security
vulnerabilities or improvements in the integration of TensorFlow and GPU.
10. XGBoost
Use this library to implement machine learning algorithms under the Gradient Boosting
framework. XGBoost is portable, flexible, and efficient. It offers parallel tree boosting
that helps teams to resolve many data science problems. Another advantage is that
developers can run the same code on major distributed environments such as Hadoop,
SGE, and MPI.
11. Plotly
This web-based tool for data visualization that offers many useful out-of-box graphics –
you can find them on the Plot.ly website. The library works very well in interactive web
applications. Its creators are busy expanding the library with new graphics and features
for supporting multiple linked views, animation, and crosstalk integration.
12. pydot
11
USER DEFINED FUNCTIONS IN PYTHON
All the functions that are written by any us comes under the category of user defined
functions. Below are the steps for writing user defined functions in Python.
An indented block of statements follows the function name and arguments which
contains the body of the function.
Syntax:
def function_name():
statements
Parameterized Function
The function may take arguments(s) also called parameters as input within the opening
and closing parentheses, just after the function name followed by a colon.
Syntax:
statements
12
.
Default arguments
Keyword arguments
The idea is to allow caller to specify argument name with values so that caller does not
need to remember order of parameters.
Example:
print(firstname, lastname)
The special syntax *args in function definitions in Python is used to pass a variable
number of arguments to a function. It is used to pass a non-keyworded, variable-length
argument list.
One important thing to note is, in Python every variable name is a reference. When we
pass a variable to a function, a new reference to the object is created. Parameter
passing in Python is same as reference passing in Java.
13
Function with return value
Sometimes we might need the result of the function to be used in further process.
Hence, a function should also returns a value when it finishes it’s execution. This can be
achieved by return statement.
Since there is various purpose of using a file along with Python (i.e., read, write,
append), it is important to specify each time for what operations Python should expect
on the file. Thus, there are various access modes which we have to specify while
opening a file in a program.
In order to connect our program with the desired file, we need a stream that can fetch or
write data in it. For this purpose, there are already some in-built classes/functions which
we can utilize to solve the purpose. The first thing that we need to do is create a file
object, i.e., Instance of File class which we can do using file() or open() function. In
order to open a file -
Note that this time your file.txt is not in the same folder as in above case, thus here you
will have to specify the whole location.
Once the file had been opened there is something called pointer that points to some
position in the file. This pointer is used to read/write from that position. This pointer is
14
pretty much like a text cursor which can be shifted freely (using arrow keys) or used to
write or delete the text from a text, except that pointer can shift/read/write only through
some functions.
About access modes now, following are the available access modes that are to be
specified in the argument-
read mode - "r" for text files and "rb" for binary files. File pointer points at the beginning
of the file.
write mode - "w" for text files and "wb" for binary files. File pointer points at the
beginning of the file.
append mode - "a" for text files and "ab" for binary files. File pointer points at the end of
the file.
read/write mode - "r+" or "w+" provide the option for doing both read and write operation
on the same file object. "rb+" or "wb+" for binary files. File pointer points at the
beginning of the file.
append/read - "a+" to enable read/append mode, "ab+" for append/read mode on binary
files. File pointer points at the end of the file.
>>> myFile.close()
Another way of using a file is using with keyword. Looking at syntax will make it clear
how this works-
15
// operations to perform on "file.txt"
readline() function is used to read a line in the document. It can be used like:
>>> myFile.readline()
where myFile is the instance of the file. readline() function will simply print the whole line
starting from the cursor's position.
In order to print the whole content of the file, iterating line by line, we can use a for loop:
print (line)
Beside using iteration, there is another way of reading the whole file, using readlines()
function(notice it is readlines, which is different from readline). Using the function will
return a list that will contain each line of the file. Because of this, one should be careful
while using this function. In case there is lots of data in the file, the list may take lots of
space, and thus making the whole reading time longer. Thus, it is recommended to use
this function only for reading shorter files which can be stored in a list efficiently.
It is used pretty much like readlines() only, except that in this case we need to store the
returned value in some variable:
content = []
This will iteratively append each line of the file on content list.
write() function is used to write a single string into the file. For example, there is a string
>>> myFile.write(content)
Or
Write can't be used for writing the content of list or tuple. In such cases, writelines()
function is used.
>>> myFile.writelines(content)
Python 3.x
As we mentioned before once you open a file there is a cursor that keeps moving once
as you read or write. It's sometimes important to move this cursor around without
making any variable read or write every time, and for this purpose, there is a seek()
function available to move to the desired location within a file.
offset decides how many bytes you want to skip, here second argument start_from is
optional, which decides from which place you want to start. Possible values can be-
17
0 - Beginning of file
2 - End of file
MODULES
BOOK DETAILS ENTRY
CUSTOMER DETAILS
SOURCE CODE
__cur = __db.cursor()
__db.autocommit(True)
18
#Function to get last date of month
else : return 30
def view_stock() :
data = __cur.fetchall()
def add_stock() :
bno = unique_book_no()
if bno :
19
cost = eval(input("Enter the Cost per Book : "))
__cur.execute("insert into stock values ({} , '{}' , '{}' , '{}' , {} , {} , {} , '{}')".format(bno , bname , auth , publ , cost , stock , 0,
__dt.date.today()))
def add_user() :
if passwd == passwd2 :
print("Created Successfully!!!")
def sell_book() :
print('Purchase')
20
__cur.execute("update stock set Available_Stock = Available_Stock - 1 where Book_No = {}".format(bno))
print("Bought Successfully")
q = '''Book Shop\nName : {}\nPhone No : {}\nBook Number : {}\nBook Name : {}\nCost : {}\nDate Of Purchase :
filename = mktemp('.txt')
open(filename , 'w').write(q)
startfile(filename , 'print')
if __cur.rowcount == 1 :
print("STOCK OF ")
print("EXHAUSTED")
def unique_book_no () :
data = __cur.fetchall()
if bool(data[0][0]) :
shuffle(L1)
return L1.pop(0)
def view_sales () :
21
__cur.execute("select distinct(s.Book_Name) , s.qty_purchased from stock s , purchased p where s.Book_No = p.Book_No
data = __cur.fetchall()
L1 , L2 = [] , []
L1.append(row[0])
L2.append(row[1])
plt.bar(L1 , L2)
plt.xlabel('Books')
plt.ylabel('Sales')
plt.title('Sales')
plt.show()
def login():
__cur.execute("Select * from users where (username = '{}' and password = '{}')".format(user , pwd))
def update_stock() :
data = __cur.fetchall()
22
print("Updated Successfully")
=================================================================================================
db.autocommit(True)
cur = db.cursor()
cur.execute("use book_shop")
Book_Name varchar(255),\
Author varchar(255),\
Publisher varchar(255),\
Cost_per_Book float,\
Available_Stock bigint,\
qty_purchased bigint,\
purchased_on date)")
cur.execute("create table users(username varchar(255) , password varchar(255) , check (username <> 'ADMIN'))")
cur.execute("create table purchased (Book_no bigint , purchased_on date , foreign key(Book_no) references stock(Book_No))")
23
cur.close()
db.close()
import Book
c = 'y'
print('1. Register')
print('2. Login')
print('3. Exit')
if choice4 == 1 :
Book.clrscreen()
Book.add_user()
elif choice4 == 2 :
Book.clrscreen()
if Book.login() :
Book.clrscreen
C = 'y'
Book.clrscreen()
print("3. Exit")
if choice == 1 :
Book.clrscreen()
24
print("Book Book".center(89 , '='))
print("4. Exit")
if choice2 == 1 :
Book.clrscreen()
Book.add_stock()
elif choice2 == 2 :
Book.clrscreen()
Book.view_stock()
elif choice2 == 3 :
Book.clrscreen()
Book.update_stock()
elif choice2 == 4 :
print("Good Bye")
break
elif choice == 2 :
Book.clrscreen()
print("3. Exit")
if choice3 == 1 :
Book.clrscreen()
25
Book.sell_book()
elif choice3 == 2 :
Book.clrscreen()
Book.view_sales()
elif choice3 == 3 :
print("Good Bye")
break
elif choice == 3 :
print("Good Bye")
break
else :
elif choice4 == 3 :
print("Good Bye")
break
OUTPUT
26
TESTING
TESTING METHODS
27
Software testing methods are traditionally divided into black box testing and white
box testing. These two approaches are used to describe the point of view that a test
engineer takes when designing test cases.
SPECIFICATION-BASED TESTING
Specification-based testing aims to test the functionality of software according to
the applicable requirements.[16] Thus, the tester inputs data into, and only sees the
output from, the test object. This level of testing usually requires thorough test cases to
be provided to the tester, who then can simply verify that for a given input, the output
value (or behaviour), either "is" or "is not" the same as the expected value specified in
the test case. Specification-based testing is necessary, but it is insufficient to guard
against certain risks
The black box tester has no "bonds" with the code, and a tester's perception is
very simple: a code must have bugs. Using the principle, "Ask and you shall receive,"
black box testers find bugs where programmers don't. But, on the other hand, black box
testing has been said to be "like a walk in a dark labyrinth without a flashlight," because
the tester doesn't know how the software being tested was actually constructed.
That's why there are situations when (1) a black box tester writes many test
cases to check something that can be tested by only one test case, and/or (2) some
28
parts of the back end are not tested at all. Therefore, black box testing has the
advantage of "an unaffiliated opinion," on the one hand, and the disadvantage of "blind
exploring," on the other.
White box testing, by contrast to black box testing, is when the tester has access
to the internal data structures and algorithms (and the code that implement these)
White box testing methods can also be used to evaluate the completeness of a
test suite that was created with black box testing methods. This allows the software
team to examine parts of a system that are rarely tested and ensures that the most
important function points have been tested.
29
FunctionCoverage: Which reports on functions executed and
StatementCoverage:Which reports on the number of lines executed to
complete the test.
They both return coverage metric, measured as a percentage
30
II. PROCESSOR : PENTIUM(ANY) OR AMD
SOFTWARE REQUIREMENTS:
I. Windows OS
II. Python
BILIOGRAPHY
31
1. Computer science With Python - Class X// By : HARIPRASATH.B
2. A Project Report On LIBRARY Management System (LMS)
By : HARIPRASATH.B
3. Website: https://www.w3resource.com
***
32