15,309,011 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..
garima alreja 4-Dec-12 13:43pm View

sir actuaally my project is about draw hexagonal cells
i am trying it hard to give the concept of oops and graphics
i know how to use graphics in c ..
but i have to apply concept of classes..
i am trying from last 1 week to apply . but all the time i am having problem is iniatialisation .. i asked from every teacher every teachers in my collage gives me a diffrent concept to apply .. i made 3-4 programs .. every1 says its correct but uh have iniatialisation problem.. so i tried for onl9 teachers but still i am trying from 12 hrs from many onl9 teachers i am not able to recover errors..
tomarroww i have to submit and have not even made hexagonal cells then i have to colour also them ..
so in a very complicated situation ? need help really ..
garima alreja 4-Dec-12 13:41pm 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..

#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;

}
#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<
garima alreja 4-Dec-12 13:33pm View

sir actuaally my project is about draw hexagonal cells
i am trying it hard to give the concept of oops and graphics
i know how to use graphics in c ..
but i have to apply concept of classes..
i am trying from last 1 week to apply . but all the time i am having problem is iniatialisation .. i asked from every teacher every teachers in my collage gives me a diffrent concept to apply .. i made 3-4 programs .. every1 says its correct but uh have iniatialisation problem.. so i tried for onl9 teachers but still i am trying from 12 hrs from many onl9 teachers i am not able to recover errors..
tomarroww i have to submit and have not even made hexagonal cells then i have to colour also them ..
so in a very complicated situation ? need help really ..
garima alreja 4-Dec-12 13:22pm View

what i dont have to delete ?
and i did int* pts = new int[12*12];
it ask me we cannot initailise class member here
i did following:-
#include<iostream.h>
#include<conio.h>
#include<graphics.h>
class hexa
{
private:
int x,y,s;
int *pts=new pts[12*12];
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 12:52pm View

i did this .. but it again gives errors that cannot convert int[12]* to const int far
infact i did some verification in code :-
#include<iostream.h>
#include<conio.h>
#include<graphics.h>
class hexa
{
private:
int x,y,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();
hexa c;

getch();
closegraph();
return 0;

}
but it again gives errors . sir please sort this i am not able to do
garima alreja 4-Dec-12 10:21am View

mam , iam not defending what sir said.. actually i was in tension that time . in a very complicated sitution due to overload .. i agreed i was rude .. and i regrett for that .. am sorry.. i didnt understood what sir said .. and was not able to recover errors .. so please kindly will you sort me.. explain me in details coz i have learnt basics of c++. i 'll be very thankfull to you .. i promise i 'll do myself the code. but just help me to recover errors..
garima alreja 4-Dec-12 10:20am View

mam , iam not defending what sir said.. actually i was in tension that time . in a very complicated sitution due to overload .. i agreed i was rude .. and i regrett for that .. am sorry.. i didnt understood what sir said .. and was not able to recover errors .. so please kindly will you sort me.. explain me in details coz i have learnt basics of c++. i 'll be very thankfull to you .. i promise i 'll do myself the code. but just help me to recover errors..
garima alreja 4-Dec-12 10:20am View

mam , iam not defending what sir said.. actually i was in tension that time . in a very complicated sitution due to overload .. i agreed i was rude .. and i regrett for that .. am sorry.. i didnt understood what sir said .. and was not able to recover errors .. so please kindly will you sort me.. explain me in details coz i have learnt basics of c++. i 'll be very thankfull to you .. i promise i 'll do myself the code. but just help me to recover errors..
garima alreja 4-Dec-12 10:14am View

mam , i am not defending what sir said .. but i was in tension that time in a very complicated situation .. so i said that .. i agreed i was rude . i regret for that .. am sorry.. i was not able to recover errors also didnt understood whatever sir said .. so please will you explain me properly the errors .. i 'll be very thankfull to you..
garima alreja 4-Dec-12 3:28am View

yah i need to implement graph theory you are right but the thing is am having problem in iniatialistion ? will you please sort the iniatialastion as i am not able to recover that in my program .. i'll be very thankfull to you
garima alreja 4-Dec-12 1:20am View

i am using turboc complier and the turbo c complier gives initialising errors :- i am not able to understand which initialising is wrong plz help me i'll be very thankfull to you ..
garima alreja 4-Dec-12 1:16am View

Content moved to OP's question.
garima alreja 4-Dec-12 1:13am View

{ 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;

}
garima alreja 4-Dec-12 1:12am View

please excuse my friend for what she said im uploading another code plzz check if that is correct...thanku
garima alreja 4-Dec-12 1:04am View

i have my ip submittion in 2 hours n ive been trying for days to correct these errors....im not very good at c++ so please help me sir
garima alreja 4-Dec-12 1:00am View

so i need to use pts[0]=int pointf(x,y)
and can you please do ammendments in code and send it to me coz i need answers fast. its really very urgent .. please.
garima alreja 4-Dec-12 0:56am View

i have to use a loop for repeatition
so what are you saying ? shall i dont use for loop and use hex::draw()
and this should be used where ?hex::draw() in main or inside class?