The Groupe Spécial Mobile (GSM) was created in 1982 to provide a standard for a mobile telephone
system. The first GSM network was launched in 1991 by Radiolinja in Finland with joint technical
infrastructure maintenance from Ericsson. Today, GSM is the most popular standard for mobile
phones in the world, used by over 2 billion people across more than 212 countries. GSM is a cellular
network with its entire geographical range divided into hexagonal cells. Each cell has a
communication tower which connects with mobile phones within the cell. All mobile phones connect
to the GSM network by searching for cells in the immediate vicinity. GSM networks operate in only
four different frequency ranges. Study the cells of a GSM mobile phone network and Model a
software module to assign at most four different frequencies for any GSM mobile phone network.
[edit note="from OP's comment"]
see i tried something please check its ok or not .. and please help me to recover errors :-
code:-
#include<iostream.h>
#include<conio.h>
#include<graphics.h>
class hexa
{
protected:
int x,y,x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6;
public:
void set()
{
x1=x;y1=y;
x2=x1+40;y2=y1;
x3=x2+15;y3=y2+15;
x4=x3+15;y4=y3+30;
x5=x4+40;y5=y4;
x6=x5+15;y6=y5+30;
}
void disp()
{
cout<<"THE GSM CELLS ARE AS FOLLOW";
}
};
class red:public hexa
{
int a1=(x1=x=30,y1=y=15),b1=(x2,y2),c1=(x3,y3),d1=(x4,y4),e1=(x5,y5),f1=(x6,y6);
int a6=(x1=x=140,y1=y=15),b1=(x2,y2),c1=(x3,y3),d1=(x4,y4),e1=(x5,y5),f1=(x6,y6);
int ptr1[14]={a1,b1,c1,e1,f1,a1};
int ptr6[14]={a6,b6,c6,e6,f6,a6};
public:
void draw1_poly()
{
cout<<drawpoly(7,ptr1);
cout<<drawpoly(7,ptr6);
}
void colour1_poly()
{
cout<<setfillsytle(SOLID_FILL,RED);
}
};
class blue:public hexa
{
int a2=(x1=x=85,y1=y=105),b1=(x2,y2),c1=(x3,y3),d1=(x4,y4),e1=(x5,y5),f1=(x6,y6);
int ptr2[14]={a2,b2,c2,e2,f2,a2};
void draw2_poly()
{
cout<<drawpoly(7,ptr2);
}
void colour2_poly()
{
cout<<setfillsytle(SOLID_FILL,BLUE);
}
};
class green:public hexa
{
int a3=(x1=x=30,y1=y=135),b1=(x2,y2),c1=(x3,y3),d1=(x4,y4),e1=(x5,y5),f1=(x6,y6);
int a7=(x1=x=140,y1=y=75),b1=(x2,y2),c1=(x3,y3),d1=(x4,y4),e1=(x5,y5),f1=(x6,y6);
int ptr3[14]={a3,b3,c3,e3,f3,a3};
int ptr7[14]={a7,b7,c7,e7,f7,a7};
void draw3_poly()
{
cout<<drawpoly(7,ptr3);
cout<<drawpoly(7,ptr7);
}
void colour3_poly()
{
cout<<setfillsytle(SOLID_FILL,GREEN);
}
};
class yellow:public hexa
{
int a4=(x1=x=85,y1=y=105),b1=(x2,y2),c1=(x3,y3),d1=(x4,y4),e1=(x5,y5),f1=(x6,y6);
int a5=(x1=x=85,y1=y=-15),b1=(x2,y2),c1=(x3,y3),d1=(x4,y4),e1=(x5,y5),f1=(x6,y6);
int ptr4[14]={a4,b4,c4,e4,f4,a4};
int ptr5[14]={a5,b5,c5,e5,f5,a5};
void draw4_poly()
{
cout<<drawpoly(7,ptr4);
cout<<drawpoly(7,ptr5);
}
void colour4_poly()
{
cout<<setfillsytle(SOLID_FILL,YELLOW);
}
};
main()
{
char colour,red,blue,green,yellow;
hexa c;
red c1;
blue c2;
green c3;
yellow c4;
int gd=DETECT,gm;
initgraph(&gd, &gm, "C:\\TurboC3\\BGI");
c.disp();
c.set();
c1.draw1_poly();
c2.draw2_poly();
c3.draw3_poly();
c4.draw4_poly();
cout<<"***********************************";
cout<<"enter the colour";
cout<<"***********************************";
cout<<1. red<<endl<<2. blue<<endl<<3. green<<endl<<4. yellow;
if (colour==red)
{
c1.colour1_poly();
}
else if(colour==blue)
{
c2.colour2_poly();
}
else if(colour==green)
{
c3.colour3_poly();
{
else (colour==yellow)
{
c4.colour4_poly();
}
getch();
closegraph();
return 0;
}