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

Computer Project (2)

Uploaded by

dsree8820
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Computer Project (2)

Uploaded by

dsree8820
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

ELECTRICITY BILLING SYSTEM

HANGMAN GAME
PROJECT REPORT

Submitted by:
Nadish.L
KASI RAHUL M

Grade: 12th

SUGUNA PIP SCHOOL


COIMBATORE-641017
2021-2022
DECLARATION

I, ______________________________,
KASI RAHUL M of class XII, hereby declare that the

Project entitled

“_______________________________________________________________
HANGMAN GAME

__________” submitted to SUGUNA PIP SCHOOL: (Affiliation number –

1930213), Nehru Nagar, Kalapatty Road, Coimbatore, Tamil Nadu – 641014.

Regard to the class XII Senior Secondary Examination for the CBSE Board, is

accord of original project work done by me under the guidance and supervision

of ALLPIOUS R, Faculty in Information technology department, Suguna PIP

School, further certify that

I. The work contained in the report is original and is done under the

general supervision of my Faculty.

II. The work has not been submitted to any other Institution/Board for

class XII Senior Secondary Examination, CBSE Board.

Name: ________________
KASI RAHUL M

Roll No.: _____________


5008
ACKNOWLEDGEMENT

I thank my family for supporting me to complete my


project successfully. I would like to express my deep
sense of gratitude to my teacher, ALLPIOUS R, Faculty
in Information technology department, Suguna PIP
School, Coimbatore, for her invaluable support and
advice which helped me to complete this project. I am
honoured to be doing this under her supervision.

I extend my gratitude to MR. POOVANNAN, Principal


and all the staff members for the support. Finally, I
heartfully thank all my dear friends and family
members, who have extended their support and
kindness intimately.
CONTENTS

S.no TOPIC

1. Synopsis

2. System Requirement

3. Introduction to Python

Program code
4.

Sample Output
5.

Conclusion
6.

Bibliography
7.
SYNOPSIS

This project has been developed with the complexities involved in manual
preparation of the “ELECTRICITY BILLING SYSTEM ”can be overcome
by applying the computer. The computerized “ELECTRICITY BILLING
SYSTEM” has been developed in The Sugana PIP School,coimbatore, the
computerized Electricity Billing Management System is user friendly and it
posses many features. The test data have proved that the result
generated by the software are accurate and has been tested with test
data.
This system is divided into five modules :-
➢ The first module deals with creating an EBS account.
➢ The second module deals with registering as a new customer.
➢ The third module deals with deleting existing EBS account.
➢ The fourth module deals with viewing the status of the bill and
payment of the bill.
➢ The fifth module deals with displaying the customer details.
SYSTEM REQUIREMENTS

Recommended System Requirements Processors:

Intel® Core™ i3 processor 4300M at 2.60 GHz. Disk space: 2 to 4 GB.

Operating systems: Windows® 10, MACOS, and UBUNTU. Python

Versions: 3.X.X or Higher.

Minimum System Requirements Processors:

Intel Atom® processor or Intel® Core™ i3 processor. Disk space: 1 GB.

Operating systems: Windows 7 or later, MACOS, and UBUNTU. Python

Versions: 2.7.X, 3.6.X.


Introduction to Python
Python is a popular programming language. It was created by Guido van
Rossum, and released in 1991.

It is used for:

• web development (server-side),


• software development,
• mathematics,
• system scripting.

What can Python do?


• Python can be used on a server to create web applications.
• Python can be used alongside software to create workflows.
• Python can connect to database systems. It can also read and modify
files.
• Python can be used to handle big data and perform complex
mathematics.
• Python can be used for rapid prototyping, or for production-ready
software development.

Why Python?
• Python works on different platforms (Windows, Mac, Linux, Raspberry
Pi, etc).
• Python has a simple syntax similar to the English language.
• Python has syntax that allows developers to write programs with fewer
lines than some other programming languages.
• Python runs on an interpreter system, meaning that code can be
executed as soon as it is written. This means that prototyping can be
very quick.
• Python can be treated in a procedural way, an object-oriented way or a
functional way.
ELECTRICITY BILLING SYSTEM
HANGMAN GAME
PROGRAM CODE:-as
import mysql.connector sql,random,datetime as dt
conn=sql.connect(host='localhost',user='root',passwd='c
omputerlab',database='EBS')
if random
import conn.is_connected():
print("successfully connected")
c='YES' or "yes" or 'Yes'
HANGMAN_PICS = ['''
V='YES' or "yes" or 'Yes'
c1=conn.cursor()
+---+
while c=='YES' or "yes" or 'Yes':
print('**********WELCOME TO ELECTRICITY BILLING
|
SYSTEM************')
print('1.NEW USER')
| print('2.EXISTING USER')
print('3.EXIT')
| choice1=int(input('ENTER YOUR CHOICE:'))
if choice1==1:
===''',''' username=input("Enter your username:")
password=input("Enter your password:")
+---+ confirmpasswd=input("Confirm your password:")
if password==confirmpasswd:
0 | info1="insert into newuser
values('{}','{}','{}')".format(username,password,confir
|mpasswd)
c1.execute(info1)
| conn.commit()
c=input("do you want to continue?(yes or
no)")
===''','''
else:
print('your confirm password is
+---+
incorrect')
print('Try again')
0 | c=input("do you want to continue?(yes or
no)")
| | elif choice1==2:
username=input('Enter your username:')
| password=input('Enter your password:')
info2="select * from newuser where
===''','''
username='{}' and
password='{}'".format(username,password)
c1.execute(info2)
data=c1.fetchall()
+---+ while V=='YES' or "yes" or 'Yes':
if any(data):
0 | print('**********WELCOME TO ELECTRICITY
BILLING SYSTEM************')
/| | print("1.ACCOUNT SETTINGS")
print("2.TRANSACTION")
print("3.VIEW CUSTOMER DETAILS")
|
print('4.EXIT')
choice2=int(input('ENTER YOUR CHOICE'))
===''',''' if choice2==1:
print('1.NEW CUSTOMER')
+---+ print('2.DELETE EXISTING ACCOUNT')
choice12=int(input('ENTER YOUR
0 | CHOICE:'))
if choice12==1:
/|\ |
accountno=random.randrange(1000000,9999999,10)
| print("your accountno
is",accountno)
===''',''' boxid=input("enter your mete
box ID:")
+---+ bankname=input('Enter your BANK
NAME :')
0 | bankbranch=input('Enter your
BANK BRANCH :')
/|\ | name=input('Enter your name
:')
/ | address=input('Enter your
address :')
areacode=int(input('Enter your
===''','''
area PIN CODE :'))
phoneno=int(input('Enter your
+---+PHONE NUMBER :'))
email=input('Enter your email
0 | :')
info2="insert
/|\ | intoAddNewCustomer
values({},'{}','{}','{}','{}',{},{},'{}','{}')".format(
/ \ | accountno,bankname,bankbranch,name,address,areacode,pho
neno,email,boxid)
==='''] c1.execute(info2)
conn.commit()
V=input("do you want to
words + 'apple banana
continue?(yes mango strawberry orange
or no)")
grape pineapple apricot lemon if coconut
V=='yes':
continue
watermelon cherry pappaya berry else: peach lichi
muskmelon ant baboon badger bat bear beaver
break
camel cat clam cobra cougarelif coyote
choice12==2:
crow
acc=input("ENTER YOUR ACCOUNT
deerNUMBER:")
dog donkey duck eagle ferret fox frog
goat goose hawk mountain lion lizard llama mole
use=input("ENTER YOUR monkey moose
mouse mule newt otter owl panda parrot pigeon
USERNAME:")
info6=c1.execute("delete from
python rabbit ram rat raven rhino salmon seal
Transaction where accountno='{}'".format(acc))
shark sheep skunk sloth snake spider stork swan
info7=c1.execute("delete from
tigerAddNewCustomer
toad trout turkey turtle
where weasel whale wolf wombat zebra'.split()
accountno='{}'".format(acc))
info8=c1.execute("delete from
newuser where username='{}'".format(use))
c1.execute(info6)
c1.execute(info7)
c1.execute(info8)
conn.commit()
print("THANK YOU FOR USING OUR
SOFTWARE,YOUR ACCOUNT IS SUCCESFULLY DELETED")
def getRandomword(wordlist):
V=input("do you want to
continue?(yes or no)")
if V=='yes':
""" continue
else:
Returns a random string from the passed list of
break
strings. elif choice2==2:
accountno=int(input('Enter your
"""
account number :'))
info10="select * from Transaction
where accountno="+str(accountno)
wordIndex = random.randint(0,len(wordList)
c1.execute(info10) -
data3=c1.fetchall()
1) for row in data3:
paid=row[6]
if paid=='yes':
return wordList[wordIndex]
print('you have already paid
the bill')
break
else:
unit=random.randint(0,101)
def displayBoard(missedLetters,print('Dear customer, you have
correctLetters,
used ',unit,'units of electricity.')
print('One unit of curent is
secretWord):
150 ruppees')
amount=150*unit
print() toda=dt.date.today()
deadline=dt.date(2020,1,30)
if deadline<toda:
print(HANGMAN_PICS[lens(missedLetters)])
fine=(toda-deadline)*30
totamt=amount+fine
print('you have dealyed for
',toda-deadline,'days.The fine per day is 30 rupees.')
GST=(15/100)*totamt
print() totalamt=totamt+GST
print('Pleae payup
',totalamt,'rupees inclding GST')
print('Missed letters: ', end=' ')p=input("Please Enter YES
to transact")
for letter in missedLetters: if p=="YES"or 'Yes'or'yes':
print("Transaction
successful")
print(letter , end=' ') print("You have paid
the bill")
else:
print('plz pay the bill
print()
sooner')
else:
blanks = '_'*len(secretWord) totamt=0
GST=(15/100)*amount
totalamt=amount+GST
for i in range(len(secretWord0); print('Pleae payup
',totalamt,'rupees inclding GST')
p=input("Please Enter YES
if secretWord[i]
to transact") in correctLetters:
if p=="YES":
print("Transaction
blanks
successful")
= blanks[:i] + secretWord[i] +
print("You have paid
blanks[i+1:]
the bill")
else:
print('plz pay the bill
sooner')
# Display the secret word with spaces between

the letters:
info3="insert into Transaction
values({},{},'{}',{},{},{},'{}')".format(accountno,unit
for,toda,totamt,GST,totalamt,p)
letter in blanks:
c1.execute(info3)
print(letter, end =' ') conn.commit()
V=input("do you want to
continue?(yes or no)")
print() if V=='yes':
continue
def getGuess(alreadyGuessed): else:
break
elif choice2==3:
"""
Returns the letter theaccountno=int(input('Enter
player entered. your
account number :'))
info4="select * from AddNewCustomer
Ensures
where the player+enters
accountno=" a single letter and
str(accountno)
c1.execute(info4)
data1=c1.fetchall()
nothing else. for row in data1:
print(" Account Number: ",
row[0])
"""
print("bankname:",row[1])
while True: print("bankbranch:",row[2])
print("Person name:",row[3])
print('Please guess aprint("Your
letter.') meter device
ID=",row[8])
print("Residential
guess = input()
address:",row[4])
print("area code:",row[5])
guess = guess.lower() print("phone number:",row[6])
print("email:",row[7])
info5="select * from
if len(guess)
Transaction where!= 1:
accountno=" + str(accountno)
c1.execute(info5)
data2=c1.fetchall()
print('Only a for
single letter is allowed.')
row in data2:

print(" Unit
elif guess in alreadyGuessed: : ",row[1])
print(" paid on:",row[2])
print("amount to be paid
print('You have
without GST:",row[3]) already guessed that letter.
print("GST=",row[4])
Choose again.')
print("amount to be paid
including GST:",row[5])
elif guess not in V=input("do you want to
continue?(yes or no)")
if V=='yes':
'abcdefghijklmnopqrstuvwxyz':continue
else:
print('Please enter abreak
letter from the
alphabet.') elif choice2==4:
info9="select accountno,totalamt
from Transaction"
else: c1.execute(info9)
L1,L2,=[],[]
return guess for L1.append(i[0])
i in c1.fetchall():

L2.append(i[1])
plt.plot(L1,L2)
plt.title("GRAPH")
def playAgain(): plt.show()
V=input("do you want to
continue?(yes or no)")
""" if V=='yes':
continue
else:
Returns True if the player wants to play again,
break
elif choice2==5:
False otherwise. print(
"THANK YOU!!!! VISIT AGAIN!!!!")
break
""" c='yes'

print('Wouldelse:
you like to play again? (y)es or
print('username / password is
incorrect')
(n)o')
break
c=input("do you want to try again?(yes
return
or no)")input().lower().startswith('y')

print('|_H_A_N_G_M_A_N_|')
else:
print(
missedLetters
"THANK YOU!!!!= '' VISIT AGAIN!!!!")
V='no'
correctLetters = ''
secretWord = getRandomWord(words)
elif choice1==3:
print( "THANK
gameIsDone = False
YOU!!!! VISIT AGAIN!!!!")
c='no'
break
# Now else:
for the game itself:
print("invalid choice")
c=input("do you want to try again?(yes or no)")
else:
while True:
print( "THANK
YOU!!!! VISIT AGAIN!!!!")
displayBoard(missedLetters, correctLetters,
c='no'
secretWord)

# Let the player enter a letter:

guess = getGuess(missedLetters +

correctLetters)

if guess in secretWord:

correctLetters = correctLetters + guess

# Check to see if the player has won:

foundAllLetters = True

for i in range(len(secretWord)):

if secretWord[i] not in correctLetters:

foundAllLetters = False
SAMPLE
break OUTPUT
if foundAllLetters:

print('You guessed it!')

Output 1:
print('The secret
***********WELCOME word is "'BILLING
TO ELECTRICITY + secretWord +
SYSTEM************
'"! You
1.NEW USER win!')
2.EXISTING USER
gameIsDone = True
3.EXIT
else:
Enter your Choice : 1
missedLetters
Enter your Username : abcd = missedLetters + guess
Enter your Password: 1234

# Password:
Confirm your Check if1234
the player has guessed too many
times
Do you want and (yes
to continue? lost.
or no): yes

if len(missedLetters) == len(HANGMAN_PICS) -1:

displayBoard(missedLetters,
correctLetters, secretWord)

print('You have run out of guesses!\nAfter '


+ str(len(missedLetters)) + ' missed
guesses and ' + str(len(correctLetters)) + '

correct guesses, the word was "' +


secretWord + '"')

gameIsDone = True
#Output
If the2:game is done, ask the player to try
again.
***********WELCOME TO ELECTRICITY BILLING SYSTEM************
1.NEW USER
if gameIsDone:
2.EXISTING USER
3.EXIT
if playAgain():
Enter your Choice : 2
EntermissedLetters
your Username: abcd= ''
Enter your Password: 1234
correctLetters =TO'' ELECTRICITY BILLING SYSTEM************
***********WELCOME
1.ACCOUNT SETTINGS
gameIsDone = False
2.TRANSACTION
secretWord
3.VIEW CUSTOMER= getRandomWord(words)
DETAILS
4.EXIT
else:
Enter your Choice: 1
break
1.NEW CUSTOMER
2.DELETE EXISTING ACCOUNT
Enter your Choice: 1
Your account no. is 7800180
Enter your meter box ID: 001
your Bank Name : HDFC
Enter your Bank Branch : Chennai
Enter your Name : xyz
Enter your Address : 13, Main road, Chennai
Enter your Pincode : 638452
Enter your Phone number :9876543210
Enter your Email : [email protected]
Output 3:
***********WELCOME TO ELECTRICITY BILLING SYSTEM************
1.NEW USER
2.EXISTING USER
3.EXIT
Enter your Choice: 2
Enter your Username: abcd
Enter your Password: 1234
***********WELCOME TO ELECTRICITY BILLING SYSTEM************
1.ACCOUNT SETTINGS
2.TRANSACTION
3.VIEW CUSTOMER DETAILS
4.EXIT
Enter your Choice: 1
1.NEW CUSTOMER
2.DELETE EXISTING ACCOUNT
Enter your Choice :2
Enter your Account Number : 7800180
Enter your Username: abcd
THANK YOU FOR USING OUR SOFTWARE YOUR ACCOUNT IS
SUCCESFULLY DELETED
Output 4:
***********WELCOME TO ELECTRICITY BILLING SYSTEM************
1.NEW USER
2.EXISTING USER
3.EXIT
Enter your Choice: 2
Enter your Username : pqrs
Enter your Password: 7890
***********WELCOME TO ELECTRICITY BILLING SYSTEM************
1.ACCOUNT SETTINGS
2.TRANSACTION
3.VIEW CUSTOMER DETAILS
4.EXIT
Enter your Choice: 2
Enter your Account Number : 7800180
Dear customer, you have used 24 units of electricity.
Please
One unit of current is 150 rupees
pay 4140.0 rupees including GST
Please Enter YES to transact: YES
Transaction Successful
You have paid the bill
Do you want to continue?(yes or no): yes
Output 5:
***********WELCOME TO ELECTRICITY BILLING SYSTEM************
1.NEW USER
2.EXISTING USER
3.EXIT
Enter your Choice :2
Enter your Username: efgh
Enter your Password: efgh
***********WELCOME TO ELECTRICITY BILLING SYSTEM************
1.ACCOUNT SETTINGS
2.TRANSACTION
3.VIEW CUSTOMER DETAILS
4.EXIT
Enter your Choice: 3
Enter your Account Number : 4615650
Account Number: 4615650
Bank Name: ICICI
Bank Branch: Erode
Person name: efgh
Your meter device ID=0001
Residential address: 11,RK Nagar, Erode
Pincode: 638057
Phone number: 9486612370
Email: [email protected]
Do you want to continue?(yes or no): no
Output 6:
***********WELCOME TO ELECTRICITY BILLING SYSTEM************
2022-01-29 19:26:05.331171
1.NEW USER
2.EXISTING USER
3.EXIT
Enter your Choice: 2
Enter your Username : efgh
Enter your Password : efgh
***********WELCOME TO ELECTRICITY BILLING SYSTEM************
1.ACCOUNT SETTINGS
2.TRANSACTION
3.VIEW CUSTOMER DETAILS
4.EXIT
Enter your Choice: 4
THANK YOU!!!! VISIT AGAIN!!!
Conclusion

This project has been developed with the complexities involved in manual
preparation of the “ELECTRICITY BILLING SYSTEM ”can be overcome
by applying the computer. The computerized “ELECTRICITY BILLING
SYSTEM” has been developed in The Sugana PIP School,coimbatore, the
computerized Electricity Billing Management System is user friendly and it
posses many features. The test data have proved that the result
generated by the software are accurate and has been tested with test
data.
BIBLIOGRAPHY

Source: Internet
➢ www.google.com
➢ www.icbse.com
➢ cbse.nic.in/curric~ 1/xii06/compscie.pdf
➢ www.quora.com
BOOKS REFERRED
➢ Computer Science with Python -Class XII (By: Sumita Arora)

You might also like