Gagan's Project
Gagan's Project
INFORMATICS PRACTICES
PROJECT REPORT ON GAMES
SUBMITTED BY
1|Page
GAMES
CERTIFICATE
This is to certify that the Project / Dissertation entitled Project Report On Games is a Bonafede
work done by Gagan N of class XII (Sr C120 A) in partial fulfillment of CBSE’s AISSCE Examination
2023-24 and has been carried out under my direct supervision and guidance. This report or a similar
report on the topic has not been submitted for any other examination and does not form a part of
any other course undergone by the candidate.
2|Page
GAMES
ACKNOWLEDGEMENT
3|Page
GAMES
TABLE OF CONTENTS
1) Abstract
2) System requirements
3) Database design
4) Coding Output
5) Screens
6) Bibliography
4|Page
GAMES
ABSTRACT
5|Page
GAMES
SYSTEM REQUIREMENTS
Hardware Components
1)VGA Monitor
2)Qwerty keyboard
3)2GB RAM
4)2.6 GHz Processor
5)Graphics card
Software Components
1)Windows 7
2)Python 3.7 with suitable modules
3)MySQL Command Client
6|Page
GAMES
DATABASE DESIGN
1) Score table:
2) Score1 table:
3) Score2 table:
7|Page
GAMES
8|Page
GAMES
CODING
while(1):
print('\t\t\tWelcome to DA QUIZ')
print('\t\t\t(1) Start game')
print('\t\t\t(2) View score')
print('\t\t\t(3) Exit')
ch=int(input('Enter your choice:'))
if(ch==1):
print('\t\t\tChoose any quiz you wanna play')
print('\t\t\t(1) Current Affairs Mania')
print('\t\t\t(2) Marvel Buff')
print('\t\t\t(3) Football Craziness')
print('\t\t\t(4) Exit')
ch1=int(input("Enter your choice"))
if(ch1==1):
def create():
import pymysql as mysq
db=mysq.connect(host="localhost", user="root",
passwd="_Narasimha_2502")
cursor=db.cursor()
9|Page
GAMES
#cursor.execute('create database scores')
#cursor.execute("CREATE TABLE score (number int, Name
varchar(100), attempted_answer varchar(100), correct_answer
varchar(100), evaluation varchar(100), score int)")
cursor.execute('USE scores')
cursor.execute('show tables')
cursor.execute('commit')
X=int(0)
10 | P a g e
GAMES
X=X-1
print("QUESTION 2:Which southern state of India has recently
passed Anti-Cow Slaughter Bill?\n(1) Andhra Pradesh\n(2) Tamil Nadu\
n(3) Karnataka\n(4) Telangana")
C2=int(input("Choose your answer"))
if(C2==3):
D2=str("Answer is correct:)1 mark obtained")
print("Answer is correct:)1 mark obtained")
X=X+1
else:
D2=str("Answer is incorrect:( 1 mark deducted")
print("Answer is incorrect:( 1 mark deducted")
print("Correct answer is (3) Karnataka")
X=X-1
print("QUESTION 3:The strategic Chardham highway project is
being constructed in which Indian state?\n(1) Uttar Pradesh\n(2)
Rajasthan\n(3) Bihar\n(4) West Bengal")
C3=int(input("Choose your answer"))
if(C3==2):
D3=str("Answer is correct:) 1 marks obtained")
print("Answer is correct:) 1 marks obtained")
X=X+1
else:
D3=str("Answer is incorrect:( 1 mark deducted")
print("Answer is incorrect:( 1 mark deducted")
11 | P a g e
GAMES
print("Correct answer is (2) Rajasthan")
X=X-1
print("QUESTION 4:Air India, which was privatised recently
was acquired by\n(1)Tata group of companies\n(2)Adani group of
companies\n(3)Birla group of companies\n(4)Reliance group of
companies")
C4=int(input("Choose your answer"))
if(C4==1):
D4=str("Answer is correct:) 1 marks obtained")
print("Answer is correct:) 1 marks obtained")
X=X+1
else:
D4=str("Answer is incorrect:( 1 mark deducted")
print("Answer is incorrect:( 1 mark deducted")
print("Correct answer is (1) Tata group of companies")
X=X-1
print("QUESTION 5:What is the name of the portal and
application launched for booking Government holiday homes and
event venues?\n(1) E-Venue\n(2) E-Programme\n(3) E-Yojana\n(4) E-
Sampada")
C5=int(input("Choose your answer"))
if(C5==4):
D5=str("Answer is correct:) 1 marks obtained")
print("Answer is correct:) 1 marks obtained")
X=X+1
12 | P a g e
GAMES
else:
D5=str("Answer is incorrect:( 1 mark deducted")
print("Answer is incorrect:( 1 mark deducted")
print("Correct answer is (4) E-sampada")
X=X-1
print("Your score is:",X)
db=mysq.connect(host="localhost",user="root",passwd="_Narasimha_
2502",database="scores")
cursor=db.cursor()
query1='insert into score values(1,'+"'"+str(Name)
+"'"+","+str(C1)+",1,'"+str(D1)+"'"+","+str(X)+")"
query2='insert into score values(1,'+"'"+str(Name)
+"'"+","+str(C2)+",3,'"+str(D2)+"'"+","+str(X)+")"
query3='insert into score values(1,'+"'"+str(Name)
+"'"+","+str(C3)+",2,'"+str(D3)+"'"+","+str(X)+")"
query4='insert into score values(1,'+"'"+str(Name)
+"'"+","+str(C4)+",2,'"+str(D4)+"'"+","+str(X)+")"
query5='insert into score values(1,'+"'"+str(Name)
+"'"+","+str(C5)+",4,'"+str(D5)+"'"+","+str(X)+")"
cursor.execute(query1)
cursor.execute(query2)
cursor.execute(query3)
cursor.execute(query4)
13 | P a g e
GAMES
cursor.execute(query5)
db.commit()
db=mysq.connect(host="localhost",user="root",passwd="_Narasimha_
2502",database="scores")
cursor=db.cursor()
query="SELECT evaluation FROM score where
Name="+"'"+str(Name)+"'"
#print(query)
db=mysq.connect(host="localhost",user="root",passwd="_Narasimha_
2502",database="scores")
cursor=db.cursor()
query="SELECT*FROM score"
cursor.execute(query)
records=cursor.fetchall()
#print(records)
print("Your scores are as below:-)")
seqno=1
for record in records:
print("Result for given question number"+str(seqno)
+"is"+str(record))
seqno=seqno+1
print("Your Total score is:"+str(X))
create()
elif(ch1==2):
14 | P a g e
GAMES
def create1():
import pymysql as mysq
db=mysq.connect(host="localhost",user='root',passwd='_Narasimha_2
502')
cursor=db.cursor()
#cursor.execute('DROP database scores1')
#cursor.execute('create database scores1')
cursor.execute('USE scores1')
#cursor.execute('CREATE TABLE score (number int,Name
varchar(100), attempted_answer varchar(100),
correct_answervarchar(100), evaluation varchar(100), score int)')
cursor.execute('commit')
X1=int(0)
Name1=str(input('please enter your name:'))
print("Database scores1 created successfully")
print('TABLE score created successfully')
print('cursor.execute("show tables")')
print("QUESTION 1: Whose power exceeds that of the
'Sorceror Supreme'?\n(1)Clint Barton\n(2)Black Widow\n(3)Scarlet
Witch\n(4)Captain Marvel")
C1=int(input("Choose your answer:"))
if(C1==3):
15 | P a g e
GAMES
D1=str("Answer is correct:) 1 mark obtained")
print("Answer is correct:) 1 mark obtained")
X1=X1+1
else:
D1=str("Answer is incorrect:( 1 mark deducted")
print("Answer is incorrect:( 1 mark deducted")
print("Correct answer is (3)Scarlet Witch")
X1=X1-1
print("QUESTION 2: Who is the Winter Soldier?\n(1)Bucky
Barnes\n(2)Steve Rogers\n(3)Tony Stark\n(4)Natasha Romanoff")
C2=int(input("Choose your answer:"))
if(C2==1):
D2=str("Answer is correct:) 1 mark obtained")
print("Answer is correct:) 1 mark obtained")
X1=X1+1
else:
D2=str("Answer is incorrect:( 1 mark deducted")
print("Answer is incorrect:( 1 mark deducted")
print("Correct answer is (1)Bucky Barnes")
X1=X1-1
print("QUESTION 3: What does the TVA stand for?\n(1)Time
Violation Agency\n(2)Tennessee Valley Authority\n(3)Tax Verification
Audit\n(4)Time Variance Authority")
C3=int(input("Choose your answer:"))
16 | P a g e
GAMES
if(C3==4):
D3=str("Answer is correct:) 1 mark obtained")
print("Answer is correct:) 1 mark obtained")
X1=X1+1
else:
D3=str("Answer is incorrect:( 1 mark deducted")
print("Answer is incorrect:( 1 mark deducted")
print("Correct answer is (4)Time Variance Authority")
X1=X1-1
print("QUESTION 4: Who gets stabbed in the back at the end
of Spiderman:No Way Home?\n(1)Andrew Garfield's Spiderman\
n(2)Tom Holland's Spiderman\n(3)Tobey Maguire's Spiderman\
n(4)Green Goblin")
C4=int(input("Choose your answer:"))
if(C4==3):
D4=str("Answer is correct:) 1 mark obtained")
print("Answer is correct:) 1 mark obtained")
X1=X1+1
else:
D4=str("Answer is incorrect:( 1 mark deducted")
print("Answer is incorrect:( 1 mark deducted")
print("Correct answer is (3)Tobey Maguire's Spiderman")
X1=X1-1
print("QUESTION 5: Who is Spiderman?\n(1)Peter Parker\
n(2)Eddie Brock\n(3)Harry Osborn\n(4)Flash Thompson")
17 | P a g e
GAMES
C5=int(input("Choose your answer:"))
if(C5==1):
D5=str("Answer is correct:) 1 mark obtained")
print("Answer is correct:) 1 mark obtained")
X1=X1+1
else:
D5=str("Answer is incorrect:( 1 mark deducted")
print("Answer is incorrect:( 1 mark deducted")
print("Correct answer is (1)Peter Parker")
X1=X1-1
import mysql.connector as mysq
db=mysq.connect(host="localhost",user="root",passwd="_Narasimha_
2502",database="scores1")
cursor=db.cursor()
query1='insert into score
values(1,'+"'"+str(Name1)+"'"+","+str(C1)+",1,'"+str(D1)+"'"+","+str(X1)
+")"
query2='insert into score
values(1,'+"'"+str(Name1)+"'"+","+str(C2)+",3,'"+str(D2)+"'"+","+str(X1)
+")"
query3='insert into score
values(1,'+"'"+str(Name1)+"'"+","+str(C3)+",2,'"+str(D3)+"'"+","+str(X1)
+")"
18 | P a g e
GAMES
query4='insert into score
values(1,'+"'"+str(Name1)+"'"+","+str(C4)+",2,'"+str(D4)+"'"+","+str(X1)
+")"
query5='insert into score
values(1,'+"'"+str(Name1)+"'"+","+str(C5)+",4,'"+str(D5)+"'"+","+str(X1)
+")"
cursor.execute(query1)
cursor.execute(query2)
cursor.execute(query3)
cursor.execute(query4)
cursor.execute(query5)
db.commit()
db=mysq.connect(host="localhost",user="root",passwd="_Narasimha_
2502",database="scores1")
mycursor=db.cursor()
query="SELECT evaluation FROM score where
Name="+"'"+str(Name1)+"'"
#print(query)
db=mysq.connect(host="localhost",user="root",passwd="_Narasimha_
2502",database="scores1")
cursor=db.cursor()
query="SELECT*FROM score"
cursor.execute(query)
19 | P a g e
GAMES
records=cursor.fetchall()
#print(records)
print("Your scores are as below:-)")
seqno=1
for record in records:
print("Result for given question number"+str(seqno)
+"is"+str(record))
seqno=seqno+1
print("Your Total score is:"+str(X1))
create1()
elif(ch1==3):
def create2():
import pymysql as mysq
db =
mysq.connect(host="localhost",user="root",passwd="_Narasimha_250
2")
cursor= db.cursor()
#cursor.execute("DROP database scores2")
#cursor execute('create database scores2')
#cursor.execute('USE scores2')
#cursor execute("CREATE TABLE score (number int, Name
varchar(100), attempted_answer varchar(100), correct_answer
varchar(100), evaluvation varchar(100) score int)")
#cursor.execute('commit')
X2=int(0)
20 | P a g e
GAMES
Name2= str(input('Please enter your name: '))
#print("Database scores created successfully")
#print("TABLE score created successfully")
#print ("cursor.execute(‘show tables’)")
print('QUESTION 1: Which country won the FIFA world cup in
its inaugral year?\n(1)Brazil\n(2)Germany\n(3)Uruguay\n(4)Spain')
C1=int(input('Choose your answer:'))
if(C1==3):
D1=str('Answer is correct:) 1 mark obtained')
print('Answer is correct:) 1 mark obtained')
X2=X2+1
else:
D1=str("Answer is incorrect:( 1 mark deducted")
print("Answer is incorrect:( 1 mark deducted")
print("Correct answer is (3) Uruguay")
X2=X2-1
print("QUESTION 2: Who has won the maximum number of
Ballon d'or the maximum number of times?\n(1)Ronaldinho Gaucho\
n(2)Lionel Messi\n(3)Cristiano Ronaldo\n(4)Thierry Henry")
C2=int(input('Choose your answer:'))
if(C2==2):
D2=str('Answer is correct:) 1 mark obtained')
print('Answer is correct:) 1 mark obtained')
X2=X2+1
21 | P a g e
GAMES
else:
D2=str("Answer is incorrect:( 1 mark deducted")
print("Answer is incorrect:( 1 mark deducted")
X2=X2-1
print('QUESTION 3:Who is fondly known as "El pibe de oro"
(The Golden Boy) by fans of football\n(1)Lionel Messi\n(2)Cristiano
Ronaldo\n(3)Ronaldo Nazario\n(4)Diego Maradona')
C3=int(input('Choose your answer:'))
if(C3==4):
print('Answer is correct:) 1 mark obtained')
D3=str('Answer is correct:) 1 mark obtained')
X2=X2+1
else:
print("Answer is incorrect:( 1 mark deducted")
D3=str("Answer is incorrect:( 1 mark deducted")
print("Correct answer is (4) Diego Maradona")
X2=X2-1
print('QUESTION 4:How many times has Brazil won the FIFA
world cup?\n(1)2\n(2)3\n(3)5\n(4)10')
C4=int(input('Choose your answer:'))
if(C4==3):
D4=str('Answer is correct:) 1 mark obtained')
print('Answer is correct:) 1 mark obtained')
X2=X2+1
22 | P a g e
GAMES
else:
print("Answer is incorrect:( 1 mark deducted")
D4=str("Answer is incorrect:( 1 mark deducted")
print("Correct answer is (3)5")
X2=X2-1
print('QUESTION 5:Mancester United is a team which plays in
the\n(1)La Liga\n(2)Bundesliga\n(3)Ligue 1\n(4)English Premier
League')
C5=int(input('Choose your answer:'))
if(C5==4):
D5=str('Answer is correct:) 1 mark obtained')
print('Answer is correct:) 1 mark obtained')
X2=X2+1
else:
D5=str('Answer is incorrect:( 1 mark deducted')
print('Answer is incorrect:( 1 mark deducted')
print('Correct answer is (4) English Premier League')
X2=X2-1
import mysql.connector as mysq
db=mysq.connect(host="localhost",user="root",passwd="_Narasimha_
2502",database="scores2")
cursor=db.cursor()
23 | P a g e
GAMES
query1='insert into score
values(1,'+"'"+str(Name2)+"'"+","+str(C1)+",3,'"+str(D1)+"'"+","+str(X2)
+")"
query2='insert into score
values(1,'+"'"+str(Name2)+"'"+","+str(C2)+",2,'"+str(D2)+"'"+","+str(X2)
+")"
query3='insert into score
values(1,'+"'"+str(Name2)+"'"+","+str(C3)+",4,'"+str(D3)+"'"+","+str(X2)
+")"
query4='insert into score
values(1,'+"'"+str(Name2)+"'"+","+str(C4)+",3,'"+str(D4)+"'"+","+str(X2)
+")"
query5='insert into score
values(1,'+"'"+str(Name2)+"'"+","+str(C5)+",4,'"+str(D5)+"'"+","+str(X2)
+")"
cursor.execute(query1)
cursor.execute(query2)
cursor.execute(query3)
cursor.execute(query4)
cursor.execute(query5)
db.commit()
db=mysq.connect(host="localhost",user="root",passwd="_Narasimha_
2502",database="scores2")
cursor=db.cursor()
query="SELECT evaluation FROM score where
Name="+"'"+str(Name2)+"'"
24 | P a g e
GAMES
query="SELECT*FROM score"
cursor.execute(query)
records=cursor.fetchall()
print(records)
seqno=1
print("Your scores are given below:")
for record in records:
print("Result for question number"+str(seqno)
+"is"+str(record))
seqno=seqno+1
print("Your total score is",X2)
create2()
elif(ch1==4):
def exit1():
print("\n")
print('\t\t\tThanks for playing Da quiz')
print('\t\t\tBy Sri Chaitanya bois 2021-2022')
print("\n")
print("\t\t\t\t\t===This is DA QUIZ===")
exit1()
break
elif(ch==2):
def create4():
import pymysql as mysql
25 | P a g e
GAMES
db=mysq.connect(host="localhost",user="root",passwd="_Narasimha_
2502")
cursor=db.cursor()
print("\t\t\t(1) Current Affairs Mania")
print("\t\t\t(2) Marvel Buff")
print("\t\t\t(3) Football craziness")
ch=int(input("Which quiz do ya wanna display:"))
if(ch==1):
cursor.execute('USE scores')
query="SELECT Name,score FROM score group by Name,score"
cursor.execute(query)
records=cursor.fetchall()
print("\n\n\n\n\n\n\n")
print("Name and score:")
print(records)
print("\n\n\n\n\n\n\n")
elif(ch==2):
cursor.execute('USE scores1')
query="SELECT Name,score FROM score group by
Name,score"
cursor.execute(query)
records=cursor.fetchall()
print("\n\n\n\n\n\n\n")
print("Name and score:")
26 | P a g e
GAMES
print(records)
print("\n\n\n\n\n\n\n")
elif(ch==3):
cursor.execute('USE scores2')
query="SELECT Name,score FROM score group by
Name,score"
cursor.execute(query)
records=cursor.fetchall()
print("\n\n\n\n\n\n\n")
print("Name and score:")
print(records)
print("\n\n\n\n\n\n\n")
create4()
elif(ch==3):
def exit1():
print("\n")
print('\t\t\tThanks for playing Da quiz')
print('\t\t\tBy Sri Chaitanya bois 2021-2022')
print("\n")
print("\t\t\t\t\t===This is DA QUIZ===")
exit1()
break
else:
print("Enter a valid choice")
27 | P a g e
GAMES
break
OUTPUT SCREENS
Screen-2:Choice:
28 | P a g e
GAMES
Screen-3:choosing quiz:
Screen-4: Marks
29 | P a g e
GAMES
Screen-5:Viewing Scores:
Current Affairs
Marvel Buff
30 | P a g e
GAMES
Football Craziness
31 | P a g e
GAMES
Screen-5:Exit:
32 | P a g e
GAMES
Bibliography
www.google.com
www.python.org
www.geeksforgeeks.org
www.stackoverflow.com
33 | P a g e