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

12thCOMPUTER (1)

Uploaded by

madhavanms2803
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

12thCOMPUTER (1)

Uploaded by

madhavanms2803
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 33

PRAGATHI…THE SCHOOL

Dakshina Bharatha Mahila Samaja Premises,

Whitefield Railway Station Road, Kadugodi, Bangalore – 560067

A PROJECT REPORT ON
MOVIE TICKETS DATABASE

SUBMITTED TO: SUBMITTED BY:


UMA SANKAR SIR LAKSHYA SINGH .M
M. PAARTHU REDDY
CERTIFICATE

This is to certify that Lakshya Singh .M and M.


Paarthu Reddy of class: XII of PRAGATHI…THE
SCHOOL has done their project on under my
supervision. They has taken interest and has shown
at most sincerity in completion of this project.
I certify this Project up to my expectation & as per
guidelines issued by CBSE, NEW DELHI.

Principal Project
Guide

Internal Examiner:
External Examiner:
ACKNOWLEDGEMENT

It is with pleasure that I acknowledge my sincere


gratitude to our teacher, Uma Sankar Sir, who
taught and undertook the responsibility of teaching
the subject computer science. I have been greatly
benefited from her classes.
I am especially indebted to our Principal who has
always been a source of encouragement and support
and without whose inspiration this project would not
have been a successful I would like to place on
record heartfelt thanks to him.
Finally, I would like to express my sincere
appreciation for all the other students for my batch
their friendship & the fine times that we all shared
together.
e

c
h
a
l
l
e
n
g
i
n
g

e
n
o
u
g
h

t
o

t
e
a
c
h

y
o
u

i
m
p
o
r
t
a
n
t

c
o
n
c
e
p
t
s

s
u
c
h

a
s

v
a
r
i
a
b
l
e
s
,

o
p
e
r
a
t
o
r
s
,

c
o
n
d
i
t
i
o
n
a
l

s
t
a
t
e
m
e
n
t
s
,

a
n
d
f
u
n
c
t
i
o
n
s
.

To create a Movie ticket database, you will need to:

1. Choose a programming language. There are many


different programming languages that you can use to
create a calculator, but some popular choices include
Python, Java, and C++.
2. Learn the basics of the python programming language
that you have chosen. This includes learning about
variables, operators, conditional statements, and
functions.
3. Design the calculator. What features do you want the
calculator to have? For example, do you want it to be
able to perform basic arithmetic operations (addition,
subtraction, multiplication, and division)? Do you want
it to be able to perform more advanced operations,
such as trigonometry and calculus?
4. Implement the calculator. This involves writing code to
perform the features that you have designed.
5. Test the calculator. Make sure that the calculator
works correctly by testing it with different inputs.
This calculator is very simple, but it can be used to perform
basic arithmetic operations. You can extend this calculator
to add more features, such as the ability to perform more
advanced operations or to store and recall previous
calculations.

PURPOSE OF THIS PROJECT

The purpose of a Movie ticket database project is to


teach students the basics of programming. By creating a
calculator, students can learn about important concepts
such as variables, operators, conditional statements, and
functions. They can also learn how to design and
implement a simple program.

In addition to the educational benefits, a Movie ticket


database project can also be a fun and rewarding
experience for students. Students can see their code come
to life and create something that is useful and practical.

Here are some specific benefits of a Movie ticket


database project:

 Teaches the basics of programming: A Movie ticket


database project is a great way to learn the basics of
programming concepts such as
variables, operators, conditional statements, and
functions.
 Improves problem-solving skills: Creating a
calculator requires students to think critically about how
to solve problems. They need to understand the different
mathematical operations and how to implement them in
code.
 Develops coding skills: Writing a calculator program
helps students to develop their coding skills. They learn
how to write efficient and readable code.
 Boosts creativity: A Movie ticket database project is
a great way for students to be creative. They can design
their calculator to have the features that they want and
to look the way they want.

 Provides a sense of accomplishment: Completing a


Movie ticket database project can give students a
sense of accomplishment. They can be proud of what
they have created and can use their calculator to help
themselves and others.

Overall, a Movie ticket database project is a great way


for students to learn the basics of programming, improve
their problem-solving skills, develop their coding skills,
boost their creativity, and gain a sense of accomplishment.
INTRODUCTION TO PYTHON

Python is a high-level, versatile, and


dynamically-typed programming language known for
its simplicity and readability. Created by Guido van
Rossum and first released in 1991, Python has
gained widespread popularity for a wide range of
applications, from web development to data analysis
and artificial intelligence.
Key Characteristics of Python:
Readability: Python's syntax is designed to be easy
to read, with a clear and concise structure that uses
indentation to define code blocks. This readability
minimizes the chances of syntax errors and
simplifies code maintenance.
Versatility: Python is a multipurpose language that
can be used for web development, data analysis,
scientific computing, machine learning, automation,
and more. Its extensive standard library and
numerous third-party packages make it suitable for
a wide range of applications.
Interpreted Language: Python is an interpreted
language, meaning that you don't need to compile
your code before running it. This leads to faster
development and allows for interactive
programming.
Cross-Platform: Python is cross-platform, allowing
code written in Python to run on various operating
systems without modification, as long as the
necessary Python interpreter is available.
Community and Ecosystem: Python has a large
and active community of developers who contribute
to its growth. The Python Package Index (PyPI) hosts
thousands of open-source libraries and frameworks,
making it a powerful ecosystem for development.
Open Source: Python is open-source, meaning that
it is freely available, and its source code can be
modified and redistributed under an open-source
license.

Common Use Cases:


Web Development: Python is used for creating
web applications and websites with frameworks like
Django and Flask.
Data Analysis and Visualization: Python is a top
choice for data analysis and visualization with
libraries such as NumPy, Pandas, Matplotlib, and
Seaborn.
Machine Learning and AI: Python is widely used
in the field of artificial intelligence and machine
learning with frameworks like TensorFlow, PyTorch,
and scikit-learn.
Scientific Computing: Python is employed in
scientific research, simulations, and data analysis.
Automation and Scripting: Python is ideal for
writing scripts to automate repetitive tasks, whether
it's system administration, data processing, or file
management.
Game Development: Python, along with libraries
like Pygame, is used for developing 2D games.
Internet of Things (IoT): Python is utilized in
creating applications and controlling devices in the
IoT space.
Desktop Applications: Python can be used to
create cross-platform desktop applications using
libraries such as Tkinter, PyQt, or Kivy.
Education: Python is a popular choice for teaching
programming due to its simplicity and readability.

In summary, Python is a versatile, easy-to-learn,


and powerful programming language that has
gained widespread popularity for its suitability in a
wide range of applications. Its extensive ecosystem
and community support make it a valuable tool for
both beginners and experienced developers across
various industries.

INTRODUCTION TO MYSQL

MySQL is a popular open-source relational database


management system (RDBMS) that is widely used
for managing and organizing data. It stores data in
tables, which are structured into rows and columns,
making it easy to retrieve, update, and manipulate
information.
Key features of MySQL:
Relational Model: Data is stored in tables, and
relationships between tables can be established
using keys (e.g., primary keys and foreign keys).

SQL (Structured Query Language): MySQL uses


SQL for querying and managing databases. SQL
allows you to insert, update, delete, and retrieve
data.

Scalability: MySQL is suitable for small applications


as well as large-scale systems, providing high
performance and flexibility.

Open-Source: MySQL is free to use, and its code is


open to modification by the community.

MySQL is widely used in web applications, data


analysis, and more, due to its reliability,
performance, and ease of use. To get started, you'll
need to install MySQL, connect to a database, and
begin running SQL commands

HARDWARE AND SOFTWARE REQUIRED

HARDWARE:
 PC
 KEYBOARD
 MOUSE
SOFTWARE:
 OPERATING SYSTEM: WINDOWS, MACOS, OR
LINUX (MOST VERSIONS SUPPORT PYTHON
AND MYSQL).
 RAM: AT LEAST 512 MB (RECOMMENDED 1
GB OR MORE).

CODING

import mysql.connector

db=mysql.connector.connect(

host="localhost",

user="laksh",

passwd="124421",

database="ticket",

auth_plugin='mysql_native_password'
)

#Check if connected or not

if db.is_connected():

print("Success")

ticketcursor=db.cursor()

#Admin Things

#Creates admin table

def makeadmin():

tablecreate = "CREATE TABLE admin (admin_name varchar(30) NOT NULL,


admin_passwd varchar(30))"

ticketcursor.execute(tablecreate)

adminreg()

def adminreg():

print("\n Please Enter some Details:")

print("\nAdmin Name :")

aname = input()

print("\nPassword:")

apasswd = input()

tableputvalue = "INSERT INTO admin (admin_name, admin_passwd) VALUES


(%s,%s)"

ticketcursor.execute(tableputvalue, (aname, apasswd))

db.commit()

# Main part of admin login


def log():

ticketcursor.execute(""" CREATE TABLE IF NOT EXISTS log

(id INT AUTO_INCREMENT PRIMARY KEY,

has_run BOOLEAN NOT NULL DEFAULT FALSE);

""")

ticketcursor.execute("SELECT id from log where id=1")

result=ticketcursor.fetchone()

if result is None:

print("Creation of admin Required:") #<---- runs the adminreg


function

makeadmin() #<--- Runs the small method on the top!

ticketcursor.execute("INSERT INTO log (has_run) VALUES (TRUE)")

db.commit()

else:

print("Admin Account Found")

#User Things

def UserReg(): #Runs first time and then runs if user creates an new
account

global username

print("\n Please Enter Details:")

print("\n User Name : ")

name=input()

print("\n Age: ")

age=int(input())
print("\n Password: ")

password=input()

print("\n Phone No: ")

phone=int(input())

print("\n Email Id: ")

email=input()

RegQ="INSERT INTO Users (username, age, password, phone_number,


email_id, has_loged_in) VALUES (%s, %s, %s, %s, %s, %s)"

ticketcursor.execute(RegQ, (name, age, password, phone, email,


True))

db.commit()

print("Registration successful! You are now logged in.")

username=name

MENU()

UserPayment() #<--- Runs the UserPayment function

def UserLogin():

global username

username = input("Enter your username: ")

password = input("Enter your password: ")

UserL = "SELECT * FROM Users WHERE username = %s AND password = %s"

ticketcursor.execute(UserL, (username, password))

result = ticketcursor.fetchone() # Fetch the result

if result:

print("Login successful!")

UserL = "UPDATE Users SET has_loged_in = TRUE WHERE username =


%s"

ticketcursor.execute(UserL, (username,))
db.commit()

print("You are now logged in!")

else:

print("Invalid login credentials. Please try again.")

UserLogin()

def UserDataBase():

ticketcursor.execute(""" CREATE TABLE IF NOT EXISTS Users

(id INT AUTO_INCREMENT PRIMARY KEY,

username VARCHAR(50) NOT NULL,

age INT NOT NULL,

password VARCHAR(255) NOT NULL,

phone_number INT NOT NULL,

email_id VARCHAR(100) NOT NULL,

has_loged_in TINYINT(1) NOT NULL DEFAULT 0);

;""")

ticketcursor.execute("SELECT id from Users where id=1")

result=ticketcursor.fetchone()

if result is None:

print("None Accounts Present Please Register")

UserReg()

else:

print("Please Login")

UserLogin()

def UserAnother():
global username

UserLogOut()

print("Do you want to register or login with another account?")

print("1. Login")

print("2. Register")

uc = int(input("Enter your choice: "))

if uc == 1:

UserLogin()

MENU()

elif uc == 2:

UserReg()

else:

print("Invalid choice. Please try again.")

UserAnother()

def UserLogOut():

UserL="UPDATE Users SET has_loged_in = FALSE WHERE username = %s"

ticketcursor.execute(UserL, (username,))

print("You have been logged out.", username)

# User HISTORY!!!

def UserPayment():

ticketcursor.execute("""CREATE TABLE IF NOT EXISTS UserPayment (

username VARCHAR(50) NOT NULL PRIMARY KEY,

movie_number INT NOT NULL,


number_of_seats INT NOT NULL,

amount_paid FLOAT NOT NULL,

seat_name VARCHAR(50) NOT NULL

);""")

db.commit()

print("User Payment table created successfully or already exists.")

def Paymentconfirm(username, movie_number, number_of_seats, amount_paid,


seat_name):

insert="INSERT INTO UserPayment (username, movie_number,


number_of_seats, amount_paid, seat_name) VALUES (%s, %s, %s, %s, %s)"

ticketcursor.execute(insert, (username, movie_number,


number_of_seats, amount_paid, seat_name))

db.commit()

print("Payment confirmed!")

def buyMovie(movie_number):

global username

print("You have selected Movie" ,movie_number)

print('''Please select your seat type:

1. Normal Seat- $100

2. Silver Seat- $150

3. Gold Seat- $200

''')

seat_name = int(input("Enter your choice: "))

if seat_name == 1:

seat_cost = 100

seat_name = "Normal Seat"

elif seat_name == 2:
seat_cost = 150

seat_name = "Silver Seat"

elif seat_name == 3:

seat_cost = 200

seat_name = "Gold Seat"

else:

print("Invalid seat type. Please try again.")

return

print("You have selected",seat_name)

print("It Costs: $",seat_cost)

print("Please enter the number of seats you want to buy: ")

number_of_seats = int(input())

amount_paid = number_of_seats * seat_cost

print("Your total amount to pay is: $",amount_paid)

print("Do you want to finalize the payment? (yes/no)")

confirm_payment = input()

if confirm_payment == "yes":

ticketcursor.execute("SELECT username FROM Users WHERE has_loged_in


= TRUE")

result = ticketcursor.fetchone()

if result:

username=result[0]

Paymentconfirm(username, movie_number, number_of_seats,


amount_paid, seat_name)

print("Payment successful!")

MENU()

else:

print("Payment cancelled.")

Mlist()
#ADMIN AREA!!! :d

def adminarea():

print("Welcome to the Admin Area!")

aname = input("Enter the admin username: ")

apasswd = input("Enter the admin password: ")

ticketcursor.execute("SELECT * FROM admin WHERE admin_name = %s AND


admin_passwd = %s", (aname, apasswd))

result = ticketcursor.fetchone()

if result:

adminmenu()

else:

print("Invalid admin username or password. Access denied.")

MENU()

def adminmenu():

print("Admin Menu:")

print("1. Show all databases")

print("2. Delete user payments")

print("3. Delete user accounts")

print("4. Go back to main menu")

choice = int(input("Enter your choice: "))

if choice == 1:

show_databases()

elif choice == 2:

delete_UserPayment()
elif choice == 3:

delete_useraccount()

elif choice == 4:

MENU()

else:

print("Invalid choice. Please try again.")

adminmenu()

def show_databases():

ticketcursor.execute("SHOW TABLES")

tables = ticketcursor.fetchall()

print("Databases:", tables)

adminmenu()

def delete_UserPayment():

print("Delete user payments:")

username = input("Enter the username of the user: ")

ticketcursor.execute("DELETE FROM UserPayment WHERE username = %s",


(username,))

db.commit()

print("User payments deleted successfully!")

adminmenu()

def delete_useraccount():

print("Delete user account:")

username = input("Enter the username of the user: ")

ticketcursor.execute("DELETE FROM Users WHERE username = %s",


(username,))

db.commit()
print("User account deleted successfully!")

adminmenu()

def exit():

UserLogOut()

print("Exiting the program. Goodbye!")

def MENU(): #The main Part of program

print("Please Select one Option")

print("")

print(''' 1. Log as another user

2. Admin Area

3. Movie List

4. Log Out

5. Exit ''')

print("Enter an choice:")

c = int(input())

if c == 1:

UserAnother()

elif c == 2:

adminarea()

elif c == 3:

print("")

Mlist()

elif c == 4:

UserLogOut()

elif c == 5:
exit()

else:

print("Invalid choice. Please try again.")

UserAnother()

# movie List!!! :)

def Mlist():

global movieoption # <--- Gets this value from Menu Function

print("""

1. Movie 1

Rating \u2B50 / \u2B50 / \u2B50 / \u2B50 / \u2B50

Timing:

Cinema:

Buy

2. Movie 2

Rating \u2B50 / \u2B50 / \u2B50 / \u2B50 / \u2B50

Timing:

Cinema:

Buy

3. Movie 3

Rating \u2B50 / \u2B50 / \u2B50 / \u2B50 / \u2B50

Timing:

Cinema:

Buy

4. Movie 4

Rating \u2B50 / \u2B50 / \u2B50 / \u2B50 / \u2B50

Timing:
Cinema:

Buy

5. Movie 5

Rating \u2B50 / \u2B50 / \u2B50 / \u2B50 / \u2B50

Timing:

Cinema:

Buy

6. Movie 6

Rating \u2B50 / \u2B50 / \u2B50 / \u2B50 / \u2B50

Timing:

Cinema:

Buy

""")

print("Please Select one Movie to Buy Option or type back to go back


to menu")

movieoption = input()

if movieoption == '1':

print("")

buyMovie(1)

elif movieoption == '2':

print("")

buyMovie(2)

elif movieoption == '3':

print("")

buyMovie(3)

elif movieoption == '4':

print("")

buyMovie(4)
elif movieoption == '5':

print("")

buyMovie(5)

elif movieoption == '6':

print("")

buyMovie(6)

elif movieoption == 'back':

print("You are going back to the main menu")

MENU()

else:

print("Invalid option. Please try again.")

Mlist()

log() # Admin Account is present or not

print("")

UserDataBase() # Check if user account is there or not

UserPayment() # Check if user payment table is there or not

print("")

MENU()
OUTPUT
Admin Registering

User Register and signing in


Menu

Another User Register and Logging in

Admin Powers

User Payment
CONCLUSION

A Movie ticket database project is a great way for


students to learn the basics of programming and to
develop their problem-solving and coding skills. It is also a
fun and rewarding experience, as students can see their
code come to life and create something that is useful and
practical.
Overall, a Movie ticket database project is a great way
for students to learn the basics of programming, improve
their problem-solving skills, develop their coding skills,
boost their creativity, and gain a sense of accomplishment.
This calculator is very simple, but it can be used to perform
basic arithmetic operations. You can extend this calculator
to add more features, such as the ability to perform more
advanced operations or to store and recall previous
calculations.

BIBLIOGRAPHY

1. WWW.SCRIBD.COM
2. WWW.WIKIPEDIA.COM
3. WWW.GOOGLE.COM
4. CLASS 11 & 12 NCERT BOOK BY SUMITA
ARORA

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