You are on page 1of 17

APARTMENT TENANT MANAGEMENT SYSTEM

21CSS101J – PROGRAMMING FOR PROBLEM-SOLVING

Mini Project Report

Submitted by

NABARUPA BANIK [Reg. No.: RA2311030010194]


B.Tech. CSE – CYBER SECURITY
DIBYASHAA PANY [Reg. No.: RA2311030010197]
B.Tech. CSE – CYBER SECURITY

SCHOOL OF COMPUTING
COLLEGE OF ENGINEERING AND TECHNOLOGY
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
(Under Section 3 of UGC Act, 1956)
S.R.M. NAGAR, KATTANKULATHUR – 603 203
CHENGALPATTU DISTRICT

November 2023

1|Page
BONAFIDE CERTIFICATE

Certified that Mini project report titled ________________________________________________ is the


bonafide work of Reg.No___________________________________Name___________________who
carried out the minor project under my supervision. Certified further, that to the best of my knowledge,
the work reported herein does not form any other project report or dissertation on the basis of which a
degree or award was conferred on an earlier occasion on this or any other candidate.

SIGNATURE SIGNATURE

(GUIDE) (HEAD OF THE DEPARTMENT)

TABLE OF CONTENTS

S No. Title Page No.

1 Problem Statement

2|Page
2 Methodology / Procedure/ Algorithm

3 Flowchart

4 Coding (C/Python)

5 Front-end code (HTML, CSS, Javascript) [Optional]

6 Modules of the proposed work

7 Results/Screenshots

8 Conclusion

9 References

1. PROBLEM STATEMENT

3|Page
2. METHODOLOGY/ PROCEDURE/
ALGORITHM

4|Page
3. FLOWCHART

5|Page
4. CODING (Python)
import mysql.connector as m

import random as r

mc=m.connect(host="localhost",user="root",password="sql@123",database="apartment")

mcu=mc.cursor()

ch='y'

6|Page
while ch=='y' or ch=='Y':

print("select from the following modes")

print("1.tenant records(entry/exit/update)\n2.visitors record(entry/exit/update)\n3.security


record(insertion/deleting)\n4.elections\n5.exit")

c=int(input("enter your desired choice:"))

if (c==1):

k="s"

while k=='s' or k=='S':

print("select from the following modes")

print("1.entry\n2.depature\n3.update\n4.display\n5.exit")

h=int(input("enter your desired choice:"))

if (h==1):

tenantname=input("Enter the name of the tenant:")

tenantPhonenumber=input("Enter the tenant's phone number:")

ownername=input("Enter the name of the owner:")

ownerNumber=input("Enter the owner's phone number:")

Housenumber=int(input("Enter the house number:"))

peopleResiding=int(input("Enter the number of people that are going to be residing in the house:"))

q1="insert into aparr(tenantname,


tenantPhonenumber,ownername,ownerNumber,Housenumber,peopleResiding)values('{}',{},'{}',{},{},
{})".format(tenantname,
tenantPhonenumber,ownername,ownerNumber,Housenumber,peopleResiding)

mcu.execute(q1)

print("Record inserted successfully")

mc.commit()

elif (h==2):

dhn=int(input("Enter the house number of the tenant to be deleted:"))

d="delete from aparr where Housenumber=%s"


7|Page
mcu.execute(d,(dhn,))

print("Record deleted sucessfully")

mc.commit()

elif (h==3):

upn=int(input("Enter the house number of the tenant to update in the record:"))

de="delete from aparr where Housenumber=%s"

mcu.execute(de,(upn,))

print("Record deleted sucessfully")

tenantname=input("Enter the name of the tenant:")

tenantPhonenumber=input("Enter the tenant's phone number:")

ownername=input("Enter the name of the owner:")

ownerNumber=input("Enter the owner's phone number:")

Housenumber=int(input("Enter the house number:"))

peopleResiding=int(input("Enter the number of people that are going to be residing in the house:"))

q2="insert into aparr(tenantname,


tenantPhonenumber,ownername,ownerNumber,Housenumber,peopleResiding)values('{}',{},'{}',{},{},
{})".format(tenantname,
tenantPhonenumber,ownername,ownerNumber,Housenumber,peopleResiding)

mcu.execute(q2)

print("Record inserted successfully")

mc.commit()

elif (h==4):

mcu.execute("select * from aparr")

p=mcu.fetchall()

for i in p:

print(i)

elif (h==5):
8|Page
break

else:

print("please enter a valid option")

k=input("enter 's' or 'S', if you want to continue , press any other key if you want to exist:")

elif (c==2):

q="l"

while q=='l' or q=='L':

print("select from the following modes")

print("1.entry\n2.depature\n3.update\n4.display\n5.exit")

h=int(input("enter your desired choice:"))

if (h==1):

Visitorname=input("Enter the name of the visitor:")

visitorPhnumber=input("Enter the visitor's phone number:")

housenumber=int(input("Enter the house number:"))

tenantname=input("Enter the name of the tenant:")

q7="insert into visitor(Visitorname,visitorPhnumber,housenumber,tenantname)values('{}',{},


{},'{}')".format(Visitorname,visitorPhnumber,housenumber,tenantname)

mcu.execute(q7)

print("Record inserted successfully")

mc.commit()

elif (h==2):

dqn=int(input("Enter the house number of the visitor to be deleted:"))

l="delete from visitor where = housenumber%s"

mcu.execute(l,(dqn,))

print("Record deleted sucessfully")

mc.commit()
9|Page
elif (h==3):

lpn=int(input("Enter the house number of the tenant to update in the record:"))

dee="delete from visitor where housenumber=%s"

mcu.execute(dee,(lpn,))

print("Record deleted sucessfully")

Visitorname=input("Enter the name of the visitor:")

visitorPhnumber=input("Enter the tenant's phone number:")

housenumber=int(input("Enter the house number:"))

tenantname=input("Enter the name of the tenant:")

q9="insert into visitor(Visitorname,visitorPhnumber,housenumber,tenantname)values('{}',{},


{},'{}')".format(Visitorname,visitorPhnumber,housenumber,tenantname)

mcu.execute(q9)

print("Record updated successfully")

mc.commit()

elif (h==4):

mcu.execute("select * from visitor")

p=mcu.fetchall()

for i in p:

print(i)

elif (h==5):

break

else:

print("please enter a valid option")

q=input("enter 'l' or 'L', if you want to continue , press any other key if you want to exist:")

elif (c==3):

x="z"
10 | P a g e
while x=='z' or x=='Z':

print("select from the following modes")

print("1.new gaurd\n2.gaurd exiting\n3.updating\n4.display\n5.exit")

j=int(input("enter your desired choice:"))

if (j==1):

securityname=input("Enter the name of new security gaurd:")

securityPhnumber=input("Enter the gaurd's phone number:")

entrytime=input("Enter the gaurd's entry time (hh:mm:ss):")

exittime=input("Enter the gaurd's exit time (hh:mm:ss):")

q21="insert into security(securityname,securityPhnumber,entrytime, exittime)values('{}',


{},'{}','{}')".format(securityname,securityPhnumber,entrytime, exittime)

mcu.execute(q21)

print("Record inserted successfully")

mc.commit()

elif (j==2):

djn=int(input("Enter the phone number of the security to be deleted:"))

o="delete from security where =securityPhnumber%s"

mcu.execute(o,(djn,))

print("Record deleted sucessfully")

mc.commit()

elif (j==3):

lnn=int(input("Enter the phone number of the security to update in the record:"))

dec="delete from security where securityPhnumber=%s"

mcu.execute(dec,(lnn,))

print("Record deleted sucessfully")

securityname=input("Enter the name of new security gaurd:")


11 | P a g e
securityPhnumber=input("Enter the gaurd's phone number:")

entrytime=input("Enter the gaurd's time enrty (hh:mm:ss):")

exittime=input("Enter the gaurd's time enrty (hh:mm:ss):")

q21="insert into security(securityname,securityPhnumber,entrytime, exittime)values('{}',


{},'{}','{}')".format(securityname,securityPhnumber,entrytime, exittime)

mcu.execute(q21)

print("Record inserted successfully")

mc.commit()

elif (j==4):

mcu.execute("select * from security")

p=mcu.fetchall()

for i in p:

print(i)

elif (j==5):

break

else:

print("please enter a valid option")

x=input("enter 'Z' or 'z', if you want to continue , press any other key if you want to exist:")

elif (c==4):

mcu.execute("select Housenumber from aparr")

p=mcu.fetchall()

print("the president of the apartment this election is tenant of house number:",(r.choice(p)))

print("the vise president of the apartment this election is tenant of house number:",(r.choice(p)))

elif (c==5):

break

else:
12 | P a g e
print("please enter valid option")

ch=input("enter 'y' or 'Y', if you want to continue , press any other key if you want to exist:")

13 | P a g e
14 | P a g e
15 | P a g e
7. CONCLUSION

Apartment tenant record system is an environment where all the process of tenants in the
apartment is managed. It is done through the automated computerized method. conventionally
this system is done using papers, file and binders. This system saves the time of the
administrator. It includes process like adding additional information of tenant, maintenance of
the record. This makes the system easy to handle and feasible for finding the omission with
updating at the same time. If filed a query to search or update in a manual system, it will take a
lot of time to process the query and make a report which is a tedious job. This computerized
system stores all the data in the database which makes it easy to fetch and update whenever
needed.
16 | P a g e
8. REFERENCES

Computer Science withPython by Sumita Arora for Class 11& 12

HTTPS://WWW.W3SCHOOLS.COM/PYTHON/PYTHON_MYSQL_GETSTARTED.ASP

HTTPS://WWW.TUTORIALSPOINT.COM/PYTHON/
PYTHON_DATABASE_ACCESS.HTM

HTTPS://PYTHONSPOT.COM/MYSQL-WITH-PYTHON/

17 | P a g e

You might also like