C Project PDF
C Project PDF
C Project PDF
(Deemed to be University)
SUBMITTED BY:
ID NUMBER NAME
190040182 J.PALLAVI
ASSISTANT PROFESSOR
KL UNIVERSITY
Green fields, Vaddeswaram – 522 502
Guntur Dt., AP, India.
DEPARTMENT OF BASIC ENGINEERING SCIENCES-1
CERTIFICATE
1
ACKNOWLEDGEMENTS
I express the sincere gratitude to our principal Prof Dr. N. Venkataram for his
administration towards our academic growth.
I express sincere gratitude to HOD-BES-1 Dr. L. Sridhara Rao for his leadership
and constant motivation provided in successful completion of our academic semester. I
record it as my privilege to deeply thank for providing us the efficient faculty and facilities to
make our ideas into reality.
I express my sincere thanks to our project supervisor Mr. ZEELAN BASHA sir for
his novel association of ideas, encouragement, appreciation and intellectual zeal which
motivated us to venture this project successfully.
Name: J.PALLAVI
2
ABSTRACT
The Modern Periodic Table project is a simple console application built without the use of
graphics. It is developed using the C programming language for the purpose of storing name,
symbol, atomic number, atomic weight, and some important properties as well as to display
them as per requirement of the user.
This project will help you to understand file handling in C i.e. creating a file and
accessing the stored data in the file, modifying and removing the stored data. It will also help
you to understand the use of functions as well as different parameters of C programming
language.
3
INDEX
1 Introduction 6
2.1 Advantages 8
2.2 Disadvantage 8
3 System Requirements 9
4 Algorithm 10
5 Data Diagram 12
6 Implementation 16
8 Conclusion 29
4
1. INTRODUCTION
Problem definition: The problem is used to find elements by using atomic weight , atomic
number, element symbol in the modern periodic table
We have used
• Elements
• Atomic weight
• Atomic number
• Element symbol
• void add(): This function is used to input or add the information of new element to
the program.
• void explore(): This function is used to explore the stored information in the file
created.
• void mainscreen(): It is included in source code of project file in order to print the
text style and to control its color.
• void mainscreen(): This function is used to print the main screen or menu of the
project.
The key features of Modern Periodic Table mini project in C are briefly described
below:
• Storage of Element Information: In the project, you can add any new element
with its name, symbol, atomic number, atomic weight and its some important
5
properties. When new element information is to be added to this Modern Periodic
Table, you have to enter 1 in the main menu and input information in given
format. These information are stored in file created on the hard disk of computer
by program itself.
6
2. AIM OF THE PROJECT
To design a program for creating modern periodic table search by using turbo -c
which helps the new users also to search easily the required elements by typing its name,
symbol, atomic number ,atomic weight of elements.
2.1 Advantages:-
This project will help you to understand file handling in C i.e. creating a file and accessing
the stored data in the file, modifying and removing the stored data. It will also help you to
understand the use of functions as well as different parameters of C programming language.
2.2 Disadvantages:-
If you want to search by Atomic weight you have to mention the exact weight
With this program we can easily search any element and know about its properties
7
3. SYSTEM REQUIREMENTS
➢ SOFTWARE REQUIREMENTS:
The major software requirements of the project are as follows:
Language : Turbo-C
Operating system: Windows Xp or above.
➢ HARDWARE REQUIREMENTS:
The hardware requirements that map towards the software are as follows:
RAM :2GB
8
5. Algorithm
Step1: Start.
Step 4: Enter information of elements, name, symbol, atomic number, atomic weight.
Step 6: Enter the corresponding numbers, search by name, Search by symbol, search by
atomic number, search by atomic, Weight, return by main menu.
Step 10: Selected symbol, if step 10 is correct it goes to step 11 otherwise step12.
Step 12: Selected atomic number, if step 12 is correct it goes to step 13 otherwise step 14.
Step 14: Selected atomic weight, if step 14 is correct it goes to step 15 otherwise step 16.
9
Step 19: Section is 3, if step 19 is correct it goes to step 18
Step 20.
10
6. Data Diagram
11
7. IMPLEMENTATION
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
void tl();
void assign();
void add();
void explore();
void ns();
void ss();
void ans();
void aws();
void detail(int);
int y,x,r,s,an[100];
float d,aw[100]={1.008,4.003,6.941,9.012,10.81,12.01,14.01,16.00,19.00,20.18,22.99,24.31,26.98,28.09,
30.97,32.07,34.45,39.10,40.08};
Char n[100];
Char en[][1000]={“Hydrogen”, “Helium”, “Lithium”, “Beryllium”, “Boron”, “Carbon”,
“Nitrogen”, “Oxygen”, “Flourine” , “Neon”, “Sodium”, “Magnesium”, “Aluminium”,
“Silicon”, “Phosphorous”, “Sulphur”, “Chlorine”, “Argon”, “Potassium”, “Calcium”};
Char es[][1000]=
{“H”, “He”, “Li”, “Be”, “B”, “C”, “N”, “O”, “F”, “Ne”, “Na”, “Mg”, “Al”, “Si”, “P”, “S”, “Cl”,
“Ar”, “K”, “Ca”};
void main()
{
tl();
assign();
printf(“\t Menu\n\t--------\n”);
printf(“1.Add new Element information\n”);
printf(“2.Explore\n”);
printf(“3.Exit\n”);
printf(“Enter your choice”);
scanf(“%d”,&x);
switch(x)
{
Case 1:
add();
break;
Case 2:
Explore();
break();
Case 3:
tl();
printf(“\n\tExiting Bye\n”);
break;
default:
printf(“Error in choice,Exiting);
}
getch();
}
void tl();
{
printf(“Modern Periodic Table\n\tDigital\n---------------\n”);
12
}
void assign()
{
int r;
for(r=1;r<=30;r++){an[r-1]=r;}
}
void add()
{
int i;
tl();
printf(“enter element number:”);
scanf(“%d”,&i);
printf(“enter element name:”);
scanf(“%s”,en[i-1]);
printf(“enter element symbol”);
scanf(“%s”es[i-1]);
tl();
printf(“Details of your given element\n”);
printf(“element name:%s\nelement symbol:%s\n”,en[i-1],es[i-1]);
printf(“element atomic number:%d\nelement atomic weight:%.3f\n”,I,aw[i-1]);
}
void explore()
{
tl();
printf(“\t Menu\n\t----\n”);
printf(“1.search by name\n2.search by symbol\n”):
printf(“3.search by atomic number\n4.search by atomic weight\n”);
printf(“5.Exit\nEnter your choice:”);
scanf(“%d”,&y);
switch(y)
{
Case 1:
ns();
break;
Case 2:
ss();
break;
Case 3:
ans();
break:
Case 4:
aws();
break;
Case 5:
printf(“Error in choice, Exiting”);
}
}
void ns()
{
tl();
printf(“Upto 20 elements data is ready\n”);
printf(enter required symbol with first letter with capital:”)
scanf(“%s”,n);
for(r=1;r<100;r++)
{
if(strcmp(n,en[r-1]==0){break;}
}
13
{
if(strcmp(n,en[r-1]{detail(r);}
else{printf(“element is not found”);}
}
void ss()
{
tl();
printf(“Upto 20 elements data is ready\n”);
printf(“enter required symbol with first letter with capital:”);
scanf(“%d”,&n);
for(r=1;r<100;r++)
{
if(strcmp(n,es[r-1]==0{break;}
}
if(strcmp(n,es[r-1]==0{detail(r);}
else{printf(“element is not found”);}
}
void ans()
{
tl();
printf(“Upto 20 elements data is ready\n”);
printf(“enter required atomic number:”);
scanf(“%d”&s);
for(r=1;r<30;r++)
{
if(s==an[r-1]){break;}
}
if(s==an[r-1]{break(r);}
else{printf{“element is not found”);}
}
void aws()
{
tl();
printf(“Upto 20 elemts data is ready”\n);
scanf(“%f”,&d);
for(r=1;r<=100;r++)
{
if(d==aw[r-1]{break;}
}
if(d==aw[r-1]{detail(r);)}
else{printf{“elements is not found”);}
}
void detail(int q)
{
tl();
printf(“element is found\n”);
printf(“details of your given element\n”);
printf(“element name:%s\n element symbol:%s\n ,en[q-1],es[q-1]);
printf(“element atomic number:%d\n element atomic weight:%.3f\n”,q,aw[q-1]);
}
14
15
8. INTEGRATION AND SYSTEM TESTING
OUTPUTS
Screen Shots:
16
Figure 3: Output of Explore by Atomic Number
17
9. CONCLUSION
From this project we have used algorithm and data structure to understand the modern
periodic table. And prepare the implementation, it use full for new users and it also helps in
finding elements by its name, symbol, atomic number and weight of elements. this project
helps the chemist and chemistry teachers in easy way by this software .
In future if they invent new elements they can simply add element in code so that they can
update the software check the elements easily
1. By name of element
2. By symbol of element
3. By atomic number of element
4. By atomic weight of element
18
Figure 4: Periodic Table
19