Click here to Skip to main content
15,907,395 members

Comments by garima alreja (Top 25 by date)

garima alreja 4-Dec-12 15:00pm View    
i did this help me solving this program
#include <graphics.h>
#include <conio.h>
#include <iostream.h>
void draw()
{ int pointr1[14]={30,15,70,15,85,45,70,75,30,75,15,45,30,15};
int pointb[14]={85,105,125,105,140,75,125,45,85,45,70,75,85,105};
int pointg1[14]={30,135,70,135,85,105,70,75,30,75,15,105,30,135};
int pointw1[14]={85,105,125,105,140,135,125,165,85,165,70,135,85,105};
int pointw2[14]={ 85,-15,125,-15,140,15,125,45,85,45,70,15,85,-15};
int pointr2[14]={140,15,180,15,195,45,180,75,140,75,125,45,140,15};
int pointg2[14]={140,75,180,75,195,105,180,135,140,135,125,105,140,75};

drawpoly(7, pointr1);
drawpoly(7, pointb);
drawpoly(7, pointg1);
drawpoly(7, pointw1);
drawpoly(7, pointw2);
drawpoly(7, pointr2);
drawpoly(7, pointg2);
}
main()
{
int gd=DETECT,gm,pointr1[14],pointb[14],pointg1[14],pointw1[14],pointw2[14],pointr2[14],pointg2[14];
initgraph(&gd, &gm, "C:\\TurboC3\\BGI");
cout<<"THE GSM CELLS ARE AS FOLLOW";
cout<<endl;
draw();
char colour,red,blue,green,white;

cout<<"***********************************";
cout<<"enter the colour";
cout<<"***********************************";
cout<<"1. red"<< endl << "2. blue" << endl << "3. green" << endl << "4. white";
switch(colour)
{
case 1:
if(colour==red)
{
fillpoly(4,pointr1);
fillpoly(4,pointr2);
}
break;
case 2:
if(colour==blue)
{
fillpoly(1,pointb);
}
break;
case 3:
if(colour==green)
{
fillpoly(2,pointg1);
fillpoly(2,pointg2);
}
break;
case 4:
if(colour==white)
{
fillpoly(15,pointw1);
fillpoly(15,pointw2);
}
break;
default:
cout<<"given colour doesnot match";
break;
}
getch();
closegraph();
return 0;
}
garima alreja 4-Dec-12 13:48pm View    
i even did this:-
#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:
hexa()
{
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 z,w;


int ptr1[14]={x1,b1,c1,e1,f1,a1};
int ptr6[14]={a6,b6,c6,e6,f6,a6};


public:

red(){
z=30;w=15}
void draw1_poly()
{
drawpoly(7,ptr1);
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;
}
garima alreja 4-Dec-12 13:47pm View    
i even did this :-include <graphics.h>
#include <conio.h>
#include <iostream.h>
class hexa
{
int pointr1[14]={30,15,70,15,85,45,70,75,30,75,15,45,30,15};
int pointb[14]={85,105,125,105,140,75,125,45,85,45,70,75,85,105};
int pointg[14]={30,135,70,135,85,105,70,75,30,75,15,105,30,135};
int pointw[14]={85,105,125,105,140,135,125,165,85,165,70,135,85,105};
int pointr2[14]={ 85,-15,125,-15,140,15,125,45,85,45,70,15,85,-15};
int pointw2[14]={140,15,180,15,195,45,180,75,140,75,125,45,140,15};
int pointw3[14]={140,75,180,75,195,105,180,135,140,135,125,105,140,75};




public:
void draw()
{

drawpoly(7, pointr1);
drawpoly(7, pointb);
drawpoly(7, pointg);
drawpoly(7, pointw);
drawpoly(7, pointr2);
drawpoly(7, pointw2);
drawpoly(7, pointw3);

};
main()
{
int gd=DETECT,gm;
initgraph(&gd, &gm, "C:\\TurboC3\\BGI");
hexa h;
h.draw();


getch();
closegraph();
return 0;
}
garima alreja 4-Dec-12 13:46pm View    
i did this:-#include<iostream.h>
#include<conio.h>
#include<graphics.h>
class hexa
{
private:
int x,y,
int *pts[12*12],s;
float h,r;
public:

void set(){
cout<<"enter the cordinates";
cin>>x>>y;
cout<<"enter the length of hexagonal";
cin>>s;
}
void disp(){
cout<<x<<y;
cout<<s;
}
hexa()
{
h = 0.5* s;
r = 0.866*s;
pts[0][0] =x; pts[0][1] =y;
pts[1][0] =x+h; pts[1][1] = y+r;
pts[2][0] =x; pts[2][1] = y+r;
pts[3][0] =x-h; pts[3][1] =y+r;
pts[4][0] =x; pts[4][1] =y-r;
pts[5][0] =x-h; pts[5][1] =y-r;
pts[6][0] =x+h; pts[6][1] =y-r;
drawpoly(7,pts);
}
};
main()
{
hexa c;
int gd=DETECT,gm;
initgraph(&gd, &gm, "C:\\TurboC3\\BGI");
c.set();
c.disp();
getch();
closegraph();
return 0;
}
garima alreja 4-Dec-12 13:45pm View    
my project is about :-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..