Go to top

# Periodic Table

, 29 Jun 2007
 Rate this:
Please Sign up or sign in to vote.
Get Group and Period of elements in periodic table

## Introduction

The periodic table of the chemical elements is tabular method of displaying the chemical elements. The current standard table contains 117 confirmed elements as of October 16 , 2006 (While element 118 has been synthesized, element 117 has not).

## Background

I wrote a small program in Visual C++ 6 that display group and period of elements in periodic table. periodic table method returns string(as CString type) that display group and period of element. In PeriodicTable method ANumber parameter means Atomic number of element. This method define in Periodic Table.h inside _PERIDICTABLE structure.

## Using the code

A brief description of how to use the article or code.

The methods is:

```//
// CString PeriodicTable(int ANumber)
//{
int T1=0,T2=0;
int Xe[9]={2,10,18,18,36,54,86,118};
int FS[14]={1,3,11,19,37,55,87,4,12,20,38,56,88};
int Period=0;
BOOL bT=TRUE;
CString Group="";
if(ANumber>=5&&ANumber<=9)
{
T1=8-(10-ANumber);
}
else if(ANumber>=13&&ANumber<=17)
{
T1=8-(18-ANumber);
}
else if(ANumber>=31&&ANumber<=35)
{
T1=8-(36-ANumber);
}
else if(ANumber>=49&&ANumber<=53)
{
T1=8-(54-ANumber);
}
else if(ANumber>=81&&ANumber<=85)
{
T1=8-(86-ANumber);
}
else if(ANumber>=113 && ANumber<=117)
{
T1=8-(118-ANumber);
}
if((ANumber>=21&&ANumber<=30)||(ANumber>=72&&ANumber<=80))
{
T2=(ANumber%10)+2;
bT=FALSE;
if(T2==8||T2==9||T2==10)
{
T2=8;
}
if(T2>10 &&T2<=12)
{
T2=(T2%10);
}
}
if((ANumber>=57&&ANumber<=71)||(ANumber>=89&&ANumber<=103))
{
T2=3;
bT=FALSE;
}
if(ANumber>=39&&ANumber<=48)
{
T2=ANumber%10+4;
bT=FALSE;
if(T2==8||T2==9||T2==10)
{
T2=8;
}
if(T2>10&&T2<=12)
{
T2=T2%10;
}
}
if((ANumber>=104&&ANumber<=109)||(ANumber>=111 &&ANumber<=112))
{
T2=ANumber%10;
bT=FALSE;
}
if(ANumber==110)
{
T2=8;
bT=FALSE;

}
for(int y=0;y<14;y++)
{
if(ANumber==FS[y])
{
if(FS[y]%2==0)
{
T1=2;
}
else T1=1;
}
}
for(int u=0;u<9;u++)
{
if(ANumber==Xe[u])
{
T1=8;
}
}
if(ANumber==1 ||ANumber==2)
{
Period=1;
}
else if(ANumber>=3&&ANumber<=10)
{
Period=2;
}
else if(ANumber>=11&&ANumber<=18)
{
Period=3;
}
else if(ANumber>=19&&ANumber<=36)
{
Period=4;
}
else if(ANumber>=37&&ANumber<=54)
{
Period=5;
}
else if(ANumber>=55&&ANumber<=86)
{
Period=6;
}
else if(ANumber>=87&&ANumber<=118)
{
Period=7;
}

if(bT)
{
Group.Format("This Element with atomic number %d is in %d
A Group And %dth Period.",ANumber,T1,Period);
}     else if(bT==FALSE)
{
Group.Format("This Element with atomic number %dis in %d
B Group And %dth Period.",ANumber,T2,Period); }
return (CString)Group;}
```

## Points of Interest

It may be useful for determining group and period of elements.

## History

No update available.

## Copyright

This is my own code and No Copyright. So you can change or distribute it freely.

## Special Thanks

My Mother and Father

## Reference

1-Formula for determining group and period of elements is obtained from "Chemistry Education. author: hassan Soltani".

2-http://www.en.wikipedia.org

## Please visit my web blogs:

http://www.sci11.blogspot.com

http://www.sci12.blogspot.com

## License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

## Comments and Discussions

 First Prev Next
 My vote of 5 Manikandan10 24-Jun-14 22:46
 Already done, still thanks for the input ! Kochise 30-Jun-07 2:04
 Re: Already done, still thanks for the input ! Rick York 1-Jul-07 13:39
 Re: Already done, still thanks for the input ! Kochise 1-Jul-07 19:36
 Last Visit: 31-Dec-99 18:00     Last Update: 14-Sep-14 14:29 Refresh 1

General    News    Suggestion    Question    Bug    Answer    Joke    Rant    Admin

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140905.1 | Last Updated 30 Jun 2007
Article Copyright 2007 by Sayyed Mostafa Hashemi
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid