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

Mini Project

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

Mini Project

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

Front page

Page | 1
certificate

Page | 2
Page | 3
Index
Page no.
Preface 04
Acknowledgments 05
About this project 06
Source Code 07
Output 13
Limitations 21
References 22

Page | 4
Preface

I am delighted to present this project, which


represents the culmination of dedicated
effort, creativity, and a passion for coding.
This project has been prepared as per the
requirements of the Central Board of
Secondary Education (CBSE),New Delhi. This
project aims to develop a code which helps to

Page | 5
add, display, select, delete and update the
records of garments with different types,
sizes, colors, prices,etc. This project is
programmed in Python language . While
preparing the project, I tried my best to keep
the project simple and reader-friendly.

Page | 6
Acknowledgm

ents

I would like to express my deepest gratitude


to my computer science teacher Mr.
Ghazanfer Ali. I would also like to thank
hon'ble principal Sr. Gracy Joseph for giving
me a great opportunity to excel in my
learning through this project. I also thank my
parents and friends for their help and
support in finalizing this project within the
limited time frame. Their support, guidance,
and contributions have been invaluable.

Page | 7
About this

project
My Program helps to keep records of
different garments. It is very useful in
analyzing their types, sizes, colors, prices, etc.
The program allows you to add the records of
a new garment, update the existing records
of any garment, display the records of all the

Page | 8
garment, search for a garment's record and
also to delete any garment record.

Page | 9
Source Code
n = {}

ch = 1

while ch:

print('main menu\n')

print("1. Add a new Element record \n")

print("2. Search for an element record\n")

print("3. Display record of all elements\n")

print("4. Update an element information\n")

print("5. Delete an element record\n")

print("6. Exit\n")

ch = int(input('Enter your choice: '))

if ch == 1:

print("Add an element record\n")

name = input('Enter the name of the element: ')

s = {}

s['name'] = name

s['symbol'] = input('Enter the symbol of the element:')

s['atomic number'] = int(input('Enter the atomic number of the element: '))

s['atomic weight'] = float(input('Enter the atomic weight of the element: '))

Page | 10
s['atomic radius'] = float(input('Enter the atomic radius of the element: '))

s['first ionization energy'] = input('Enter the first ionization energy of the element: ')

s['oxidation state'] = int(input('Enter the oxidation state of the element: '))

s['density(g/ml)'] = float(input('Enter the density(g/ml) of the element: '))

s['melting point'] = float(input('Enter the melting point of the element: '))

s['boiling point'] = float(input('Enter the boiling point: '))

s['year of discovery'] = int(input('Enter the year of discovery of the element: '))

n[name] = s

b = input('Do you want to add more records y/n:')

while b == 'y':

name = input('Enter the name of the element: ')

s = {}

s['name'] = name

s['symbol'] = input('Enter the symbol of the element:')

s['atomic number'] = int(input('Enter the atomic number of the element: '))

s['atomic weight'] = float(input('Enter the atomic weight of the element: '))

s['atomic radius'] = float(input('Enter the atomic radius of the element: '))

s['first ionization energy'] = input('Enter the first ionization energy of the element: ')

s['oxidation state'] = int(input('Enter the oxidation state of the element: '))

s['density(g/ml)'] = float(input('Enter the density(g/ml) of the element: '))

s['melting point'] = float(input('Enter the melting point of the element: '))

s['boiling point'] = float(input('Enter the boiling point: '))

s['year of discovery'] = int(input('Enter the year of discovery of the element: '))

n[name] = s

Page | 11
b = input('Do you want to add more records y/n:')

if b=='n':

print( )

if ch == 2:

print("Search for an element record\n")

name = input('Enter the name of the element: ')

if name in n:

print('Name: ', n[name]['name'])

print('symbol: ', n[name]['symbol'])

print('atomic number: ', n[name]['atomic number'])

print('atomic weight: ', n[name]['atomic weight'])

print('atomic radius: ', n[name]['atomic radius'])

print('first ionization energy: ', n[name]['first ionization energy'])

print('oxidation state: ', n[name]['oxidation state'])

print('density(g/ml): ', n[name]['density(g/ml)'])

print('melting point: ', n[name]['melting point'])

print('boiling point: ', n[name]['boiling point'])

print('year of discovery: ', n[name]['year of discovery'])

else:

print('No such record of element exists')

if ch == 3:

print('Display record of all elements:\n')

for i in n:

print('Name: ', n[i]['name'])

Page | 12
print('Symbol: ', n[i]['symbol'])

print('Atomic number: ', n[i]['atomic number'])

print('Atomic weight: ', n[i]['atomic weight'])

print('Atomic radius: ', n[i]['atomic radius'])

print('First ionization energy: ', n[i]['first ionization energy'])

print('Oxidation state: ', n[i]['oxidation state'])

print('Density(g/ml): ', n[i]['density(g/ml)'])

print('Melting point: ', n[i]['melting point'])

print('Boiling point: ', n[i]['boiling point'])

print('Year of discovery: ', n[i]['year of discovery'])

if ch == 4:

print("Update an element's information\n")

name = input('Enter the name of the element: ')

if name in n:

print('Name: ', n[name]['name'])

print('symbol: ', n[name]['symbol'])

print('Atomic number: ', n[name]['atomic number'])

print('Atomic weight: ', n[name]['atomic weight'])

print('Atomic radius: ', n[name]['atomic radius'])

print('First ionization energy: ', n[name]['first ionization energy'])

print('Oxidation state: ', n[name]['oxidation state'])

print('Density(g/ml): ', n[name]['density(g/ml)'])

print('Melting point: ', n[name]['melting point'])

print('Boiling point: ', n[name]['boiling point'])

Page | 13
print('Year of discovery: ', n[name]['year of discovery'])

n[name]['name'] = input('Enter the new name of the element: ')

n[name]['symbol'] = input('Enter the new symbol of the element: ')

n[name]['atomic number'] = int(input('Enter the new atomic number of the element: '))

n[name]['atomic weight'] = input('Enter the new atomic weight of the element: ')

n[name]['atomic radius'] = input('Enter the new atomic radius of the element: ')

n[name]['first ionization energy'] = input('Enter the new first ionization energy of the
element: ')

n[name]['oxidation state'] = int(input('Enter the new oxidation state of the element: '))

n[name]['density(g/ml)'] = float(input('Enter the new density(g/ml) of the element: '))

n[name]['melting point'] = float(input('Enter the new melting point of the element: '))

n[name]['boiling point'] = input('Enter the new boiling point of the element: ')

n[name]['year of discovery'] = input("Enter the new year of discovery of the element:")

if ch==5:

ph= input("Do you want to delete a single record or all records y/n:")

if ph=="y":

name= input("Enter the name of the element:")

if name in n:

del n[name]

print("Deleted")

else:

print("No such element's record exists")

if ph=="n":

del n

Page | 14
print("Deleted")

if ch==6:

print("Exiting...")

break

Page | 15
Output

Output 1: Adding an element’s


record

Page | 16
Enter your choice: 1

Add an element record

Enter the name of the element: Aluminium

Enter the symbol of the element: Al

Enter the atomic number of the element: 13

Enter the atomic weight of the element: 26.982

Enter the atomic radius of the element: 143

Enter the first ionization energy of the element: 577.6

Enter the oxidation state of the element: +3

Enter the density(g/ml) of the element: 2.702

Enter the melting point of the element: 660.7

Enter the boiling point: 2467.0

Enter the year of discovery of the element: 1825

Do you want to add more records y/n:y

Enter the name of the element: Calcium

Enter the symbol of the element: Ca

Enter the atomic number of the element: 20

Enter the atomic weight of the element: 40.078

Enter the atomic radius of the element: 197

Enter the first ionization energy of the element: 589.8

Enter the oxidation state of the element: +2

Enter the density(g/ml) of the element: 1.55

Enter the melting point of the element: 839.0

Enter the boiling point: 1484.0

Page | 17
Enter the year of discovery of the element: 1808

Output 2: Searching an element’s


record

Page | 18
Enter your choice: 2

Search for an element record

Enter the name of the element: Calcium

Name: Calcium

symbol: Ca

atomic number: 20

atomic weight: 40.078

atomic radius: 197.0

first ionization energy: 589.8

oxidation state: 2

density(g/ml): 1.55

melting point: 839.0

boiling point: 1484.0

year of discovery: 1808

Output 3: Display all the records

Page | 19
Enter your choice: 3

Display record of all elements:

Name: Aluminium

Symbol: Al

Atomic number: 13

Atomic weight: 26.982

Atomic radius: 143.0

First ionization energy: 577.6

Oxidation state: 3

Density(g/ml): 2.702

Melting point: 660.7

Boiling point: 2467.0

Year of discovery: 1825

Name: Calcium

Symbol: Ca

Atomic number: 20

Atomic weight: 40.078

Atomic radius: 197.0

First ionization energy: 589.8

Oxidation state: 2

Density(g/ml): 1.55

Melting point: 839.0

Boiling point: 1484.0

Page | 20
Year of discovery: 1808

Output 4: Update an element’s


record
Page | 21
Enter your choice: 4

Update an element's information

Enter the name of the element: Aluminium

Name: Aluminium

symbol: Al

Atomic number: 13

Atomic weight: 26.982

Atomic radius: 143.0

First ionization energy: 577.6

Oxidation state: 3

Density(g/ml): 2.702

Melting point: 660.7

Boiling point: 2467.0

Year of discovery: 1825

Enter the new name of the element: Sodium

Enter the new symbol of the element: Na

Enter the new atomic number of the element: 11

Enter the new atomic weight of the element: 22.989

Enter the new atomic radius of the element: 186

Enter the new first ionization energy of the element: 495.8

Enter the new oxidation state of the element: +1

Page | 22
Enter the new density(g/ml) of the element: 0.971

Enter the new melting point of the element: 97.8

Enter the new boiling point of the element: 552.9

Enter the new year of discovery of the element: 1807

Page | 23
Output 5: Delete an element’s
record

Enter your choice: 5

Do you want to delete a single record or all records y/n: y

Enter the name of the element: Calcium

Deleted

Page | 24
Limitations

● The project is not tested in a real


environment.
● The project is further extensible.
● The existing system only provides a
text-based interface, which is not as
user-friendly as a Graphical user interface.
● The output for display is also a bit messy and
less user-friendly.
● Once the program is closed the data is lost.
● Data is not stored in an external file.

Page | 25
Page | 26
References
● Textbook: Computer Science with
Python by
Sumita Arora
● https://chat.openai.com/
● Adobe Acrobat

Page | 27

You might also like