K L UNIVERSITY
FRESHMAN ENGINEERING DEPARTMENT
Department of BES-1
A Project Based Lab Report
On
MODERN PERIODIC TABLE
SUBMITTED BY:
I.D NUMBER NAME
2100030565 GANESH.V
2100030572 MANIKUMAR.V
2100030587 JAYANTH.V
2100030592 MEGHANA.G.V
UNDER THE ESTEEMED GUIDANCE OF
AZMIIRA KRISHNA
([Link],IISC)
(ASSISTANT PROFFESOR,KLU)
KL UNIVERSITY
Green fields, Vaddeswaram – 522 502
Guntur Dt., AP, India.
DEPARTMENT OF BASIC ENGINEERING SCIENCES
CERTIFICATE
This is to certify that the project based laboratory report entitled
“MODERN PERIODIC TABLE” submitted by [Link].V bearing Regd. No.
2100030565 to the Department of Basic Engineering Sciences, KL
University in partial fulfillment of the requirements for the completion of a
project based Laboratory in “Computational Thinking for Structured Design”
course in I B Tech I Semester, is a bonafide record of the work carried out by
him/her under my supervision during the academic year 2021 – 2022.
PROJECT SUPERVISOR HEAD OF THE DEPARTMENT
[Link] KRISHNA Dr. [Link]
ACKNOWLEDGEMENTS
It is great pleasure for me to express my gratitude to our honorable
President Sri. Koneru Satyanarayana, for giving the opportunity and platform
with facilities in accomplishing the project based laboratory report.
I express the sincere gratitude to our Director Dr. A. Jagdeesh for his
administration towards our academic growth.
I express sincere gratitude to our Coordinator and HOD-BES Dr.
[Link] for her 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 [Link] for
his novel association of ideas, encouragement, appreciation and intellectual
zeal which motivated us to venture this project successfully.
Finally, it is pleased to acknowledge the indebtedness to all those who
devoted themselves directly or indirectly to make this project report success.
Name: Ganesh.V
Regd . No: 2100030565
ABSTRACT
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. 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.
INDEX
[Link] TITLE PAGE NO
1 Introduction (A)
2 Aim of the Project (1)
2.1 Advantages & Disadvantages (1)
2.2 Future Implementation (1)
3 Software & Hardware Details (2)
4 Data Flow Diagram (3)
5 Implementation (6-34)
6 Algorithm for each module (4-5)
7 Integration and System Testing (34-35)
8 Conclusion (36)
(page A)
INTRODUCTION
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.
The main functions used in designing the Modern Periodic Table project
are:
void add(): This function is used to input or add the information
of new element to the program.
void explor(): 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 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.
Exploration of element Information: Another main function of
this project is to explore or to display the stored information.
(page 1)
AIM
Advantages:-
*Our project named “MODERN PERIODIC TABLE” helps every one to
information about all chemical elements that are available.
*Our project mainly helps the faculty members of pharmacy
department in order to search the detailed information about all the
available chemical elements.
*Our project is user friendly.
*All the information is accecced through files very quickly.
Disadvantages:-
*Actually , there are no disadvantages to our project . The only
disadvantage is , we need to search element one by one , we cant
search all the elements at a time .
Future enhancements:-
*If , any chemical element is invented in future , we are ready to add
the information of newly invented chemical element in our project.
(page 2)
SYSTEM REQUIREMENTS
SOFTWARE REQUIREMENTS:
The major software requirements of the project are as follows:
Language : Turbo-C
Operating system: Windows Xp or later.
HARDWARE REQUIREMENTS:
The hardware requirements that map towards the software are as
follows:
RAM : ON OR ABOVE 4GB
Processor : 64BIT-PROCESSOR
(page 3)
DATA FLOW DIAGRAM
(page 4)
ALGORITHM
STEP 1 :- Declare any character , for example ch or c .
STEP 2 :- Now assign some size to this character (ch[80]).
STEP 3 :- Now this size is useful to read strings from user .
STEP 4 :- Read strings from user .
STEP 5 :- Initially Store chemical information in a separate
file.
STEP 6 :- if (ch[80]==”Add New element information “)
6.1 :- It will add any chemical information and stores
in a file.
STEP 7 :- if (ch[80]==”Explore”)
7.1 :- It will take us to new screen to search for new
element .
7.2 :- if (ch[80]==”Seach by name”)
7.2.1 :- Enter name to search chemical info
7.3 :- if (ch[80]==”Search by symbol”)
7.3.1 :- Enter symbol of chemical to search in file.
7.4 :- if (ch[80]==”Search by atomic number”)
7.4.1 :- Enter specifc atomic number of chemical
to search in file.
7.5 :- if (ch[80]==”Search by atomic weight”)
(page 5)
7.5.1 :- Enter atomic weight of chemical element
to search in file .
STEP 8 :- else // if above conditions not satisfied ;
8.1 :- The program will be terminated.
STEP 9 :- END OF ALGORITHM.
SOME IMPORTANT POINTS :-
1) All the chemical information is stored in other
files inorder to store the information
permanently .
2) We used the WRITE mode in files to add the new
data of chemicals into it .
3) Inorder to add any other extra chemical
information , we used APPEND mode . This
does’nt delete the previous information in file and
can add new information too .
(page 6)
IMPLEMENTATION
PROJECT CODE :-
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
struct element
{
char name[20] ;
char sb[5] ;
int atm;
float atms;
char block;
char atc[20];
char prop[250];
(page 7)
}p,q ;
int rw , cl ;
FILE*fp;
void add ();
void explor();
void print ();
void mainscreen ();
void main ()
{
int a,i,n,y;
char c,d ;
char date[15],date2[15],string1[20];
unsigned int tsz ;
clrscr();
mainscreen();
label1:
textcolor(15);
gotoxy(22,15);textcolor(14);
(page 8)
cprintf ("Enter the corresponding no") ;
gotoxy(22,19);textcolor(10);
cprintf ("[Link] the element
information");gotoxy(22,21);
cprintf ("[Link]");gotoxy(22,23);
cprintf ("[Link]");gotoxy(22,25);
fflush(stdin);
d=getch();
switch(d)
{
case '1' :
{
add();
break;
}
case '2' :
{
explor();
break ;
(page 9)
}
case '3' :
{
clrscr();
mainscreen();
textcolor(14);gotoxy(30,24);
cprintf ("THANK U");gotoxy(30,26);
cprintf ("BYE.........");
getch();
exit (1);
break;
}
default :
{
clrscr();
mainscreen();
textcolor(12+128);gotoxy(22,11);
(page 10)
cprintf ("Wrong choice");
gotoxy(22,13);text(15);
cprintf ("Retype choice");
goto label1 ;
}
}
clrscr();
mainscreen();
goto label1;
}
void mainscreen()
{
int i,j;
clrscr ();
for (i=2,j=2;i<rw;j++)
{
(page 11)
if(j>15)
j=2;
textcolor(j);
gotoxy(i,2);
cprintf ("%c",'*');
gotoxy(i,cl-1);
cprintf ("%c",'*');
i++;
}
for (i=1,j=2;i<cl;i++,j++)
{
if(j>15)
j=2;
textcolor(j);
gotoxy(2,i);
cprintf("%c",'*');
gotoxy(rw-1,i);
(page 12)
cprintf("%c",'*');
}
gotoxy(30,4);textcolor(3);
cprintf ("Modern Periodic Table");
gotoxy(37,6);textcolor(6);
cprintf ("Digital");
gotoxy(35,7);textcolor(15);
cprintf ("-----------");
}
void add()
{
char ch ;
label1:
clrscr();
mainscreen();
gotoxy(15,14);textcolor(10);
cprintf ("Enter the Information of Elements:");
(page 13)
gotoxy(15,16);
cprintf ("Name:");
gotoxy(15,18);
cprintf ("Symbol:");
gotoxy(15,20);
cprintf ("Atomic no:");
gotoxy(15,22);
cprintf("Atomic wt:");
gotoxy(15,24);
cprintf ("Atomic Config:");
gotoxy(15,26);
cprintf ("Block:");
gotoxy(15,28);
cprintf ("Properties:");
textcolor(15);
fflush(stdin);
gotoxy(20,16);
scanf ("%[^\n]",[Link]);
(page 14)
[Link][0]=toupper([Link][0]);
fflush(stdin);
gotoxy(23,18);
scanf("%[^n]",[Link]);
[Link][0]=toupper([Link][0]);
fflush(stdin);
gotoxy(25,20);
scanf ("%f",&[Link]);
fflush(stdin);
gotoxy(29,24);
scanf (" %[^n]",[Link]);
fflush(stdin);
gotoxy(21,26);
scanf ("%c" ,&[Link]);
[Link]=touper([Link]);
if([Link]!='S'&&[Link]!='P'&&[Link]!='D'&&[Link]
k!='F')
[Link]=' ';
(page 15)
fflush(stdin);
gotoxy(26,28);
scanf ("%[^n]",[Link]);
[Link][0]=toupper([Link][0]);
if((fp=fopen("data","ab+"))==NULL)
{
printf ("Cannot open the file f1");
getch();
exit(1);
}
fwrite(&p,sizeof(p),1,fp);
fclose(fp);
printf ("\n\n\n\t\tEnter 'y' for next record(y/n):");
ch=getch();
if(ch=='y')
{
goto label1 ;
}
(page 16)
}
void explor()
{
char d,c ;
FILE *f;
int given_atmic_mass;
int flag ;
char string[20];
//startofexplore;
clrscr();
mainscreen ();
label6:
gotoxy(22,15);textcolor(12);
cprintf ("Enter the corresponding
no");gotoxy(22,19);textcolor(3);
cprintf ("[Link] by 'NAME'");gotoxy(22,21);
cprintf ("[Link] by SYMBOL");gotoxy(22,23);
cprintf ("[Link] by ATOMIC
NUMBER");gotoxy(22,25);
(page 17)
cprintf ("[Link] by ATOMIC
WEIGHT");gotoxy(22,27);
cprintf ("[Link] of Diff. Blocks");gotoxy(22,29);
cprintf ("[Link] to main menu ");
gotoxy (25,32);
fflush(stdin);
d=getch();
switch(d)
{
case '1' :
{
clrscr();
mainscreen();
gotoxy(15,25);
textcolor(12);
cprintf ("Enter the name of Elemnt :");
textcolor(3);
fflush(stdin);
(page 18)
scanf ("%[^\]",string);
printf ("%s",string);
string[0]=toupper(string[0]);
if((fp=fopen("data","rb+"))==NULL)
{
clrscr();
printf ("\ncannot open the record file 1");
getch();
exit(1);
}
flag=1;
while(fread(&p,sizeof(p),1,fp))
{
if(strcmp([Link],string)==0)
{
print();
flag=0;
break;
(page 19)
}
}
if(flag==1)
{
clrscr();
mainscreen();
gotoxy(25,25);
textcolor(12);
cprintf ("::No Element Available::");
}
fclose(fp);
getch();
break ;
}
case '2' :
{
mainscreen();
gotoxy(22,15);
(page 20)
textcolor(12);
cprintf ("Enter the Symbol :");
textcolor(3);
fflush(stdin);
scanf ("%[^n]",string);
string[0]=toupper(string[0]);
if ((fp=fopen("data","rb+"))==NULL)
{
printf ("\n cannot open the record file 1");
getch();
exit(1);
}
flag=1;
while(fread(&p,sizeof(p),1,fp))
{
if(strcmp([Link],string)==0)
{
print();
(page 21)
flag=0;
break;
}
if(flag==1)
{
mainscreen();
gotoxy(25,25);
textcolor(12);
printf ("::No Element Available");
}
fclose(fp);
getch();
break;
}
case '6' :
{
return ;
(page 22)
}
case '3' :
{
mainscreen();
gotoxy(15,25);
textcolor(12);
printf ("Enter the Atomic Number of the Element:");
textcolor(3);
fflush(stdin);
scanf("%d",&given_atomic_no);
if((fp=fopen("data","rb+"))==NULL)
{
clrscr();
printf ("\ncannot open the record file 1);
getch();
exit(1);
}
flag=1;
(page 23)
while(fread(&p,sizeof(p),1,fp))
{
if([Link]==given_atomic_no)
{
print();
flag=0;
break;
}
}
if(flag=1)
{
mainscreen();
gotoxy(25,25);
textcolor(12);
cprintf ("::No Element Availabe");
}
fclose(fp);
getch();
(page 24)
break;
}
case '4' :
{
mainscreen();
gotoxy(15,22);
textcolor (12);
printf ("Enter the Atomic Mass of Element:");
textcolor(3);
fflush(stdin);
scanf ("%f",&given_atomic_mass);
if((fp=fopen("data","rb+"))==NULL)
{
clrscr();
printf ("\ncannot open the record file 1");
getch();
exit(1);
}
(page 25)
flag=1;
while(fread(&p,sizeof(p),1,fp))
{
if([Link]==given_atmic_mass)
{
print();
flag=0;
break;
}
}
if(flag==1)
{
clrscr();
mainscreen();
gotoxy(25,25);
textcolor(12);
printf ("::No Element Available::");
}
(page 26)
fclose(fp);
getch();
break;
}
case '5' :
{
clrscr();
mainscreen();
gotoxy(15,25);
textcolor(12);
printf("Enter the Block:");
textcolor(3);
fflush(stdin);
scanf("%c",&c);
c=touper(c);
if((f=fopen("temp","wb+"))==NULL)
{
clrscr();
(page 27)
printf ("\ncannot open the temp file 1");
getch();
exit(1);
}
if((fp=fopen("data","rb+"))==NULL)
{
clrscr();
printf ("\n cannot open the record file 1");
getch();
exit(1);
}
flag=1;
while(fread(&p,sizeof(p),1,fp))
{
if([Link]==c)
{
fwrite(&p,sizeof(p),1,f);
}
(page 28)
}
fclose(f);
fclose(fp);
if((f=fopen("temp","rb+"))==NULL)
{
printf ("Cannot open the File");
getch();
exit(1);
}
fseek(f,0,SEEK_END);
tsz=ftell(f);
n=(int)(tsz/sizeof(p));
for(i=0;i<(n-1);i++)
{
for (a=i+1;a<n;a++)
{
fseek(f,i*sizeof(p),SEEK_SET);
fread(&p,sizeof(p),1,f);
(page 29)
fseek(f,a*sizeof(p),SEEK_SET);
fread(&q,sizeof(p),1,f);
if(([Link])>0)
{
fseek(f,i*sizeof(p),SEEK_SET);
fwrite(&q,sizeof(p),1,f);
fseek(f,a*sizeof(p),SEEK_SET);
fflush(stdin);
fwrite(&p,sizeof(p),1,fp);
}
}
}
rewind(f);
while(fread(&p,sizeof(p),1,f))
{
print();
getch();
}
(page 30)
clrscr();
mainscreen();
gotoxy(25,25);
textcolor(12);
printf("::No Element Available::");
fclose(f);
getch();
break;
}
default :
{
clrscr();
mainscreen();
textcolor(12+128);gotoxy(22,11);
printf ("Wrong
Choice");gotoxy(22,13);textcolor(15);
printf ("Retype Choice");
goto label6 ;
(page 31)
}
}
goto startofexplore;
}
void print()
{
clrscr();
mainscreen();
gotoxy(15,16);
printf("Name:");
gotoxy(15,18);
printf ("Atomic No:");
gotoxy(15,22);
printf("Atomic Wt:");
gotoxy(15,24);
printf("Atomic Config:");
fflush(stdin);
(page 32)
gotoxy(15,26);
printf("Block:);
gotoxy(15,28);
printf("Properties:");
textcolor(6);
gotoxy(20,16);
print("%s",[Link]);
gotoxy(23,18);
printf ("%s",[Link]);
fflush(stdin);
gotoxy(25,20);
printf("%d",[Link]);
fflush(stdin);
gotoxy(25,22);
printf ("%f",[Link]);
fflush(stdin);
gotoxy(29,24);
cprintf("%s",[Link]);
(page 33)
gotoxy(21,26);
cprintf("%c",[Link]);
gotoxy(26,28);
cprintf("%s",[Link]);
}
(page 34)
INTEGRATION AND SYSTEM TESTING
OUTPUTS
Screen Shots:
(page 35)
(page 36)
CONCLUSION
Finally , This is our project . And we hope that our project
helps as many people as possible in searching of any
chemical element’s [Link] project really helps
the faculty members who are in chemistry department . We
successfully completed our project under guidance of our
CTSD faculty (AZMIIRA KRISHNA).This project can be
implemented either in Turbo c++ or Code blocks softwares.
Our project is even user friendly . So , by this , We conclude
our Project Documentation.
THANK YOU