Graphics Project : Bar Diagram [A Project work in Computer Graphics]

This was a Computer Graphics Project named Bar Diagram required in the coursework. [A Project work in Computer Graphics] #include
#include
#include
#include
#include
#include
/*FUNCTION FOR READING DATA FROM USER*/
void input(float ,float,float,float,float,float);
/*FUNCTION FOR DRAWING BAR DIAGRAM*/
void bar1 (float);
void bar2 (float);
void bar3 (float);
void bar4 (float);
void bar5 (float);
void bar6 (float);
/* MAIN PROGRAM */
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,”c:\\tc\\bgi”);
float sub1,sub2,sub3,sub4,sub5,sub6;
setbkcolor(9);
setcolor(BLUE);
settextstyle(3,0,2);
outtextxy(getmaxx()/2-130,0,”TRIBHUWAN UNIVERSITY”);
settextstyle(3,0,2);
outtextxy(getmaxx()/2-145,30,”INSTITUTE OF ENGINEERING”);
settextstyle(3,0,3);
outtextxy(getmaxx()/2-155,60,”WESTERN REGION CAMPUS”);
settextstyle(3,0,1);
outtextxy(getmaxx()/2-135,92,”LAMACHAUR-16,POKHARA”);
settextstyle(3,0,2);
outtextxy(getmaxy()/2+50,getmaxy()/2,”A”);
settextstyle(3,0,2);
outtextxy(getmaxy()/2+15,260,”PROJECT”);
settextstyle(3,0,2);
outtextxy(getmaxy()/2+40,getmaxy()/2+40,”ON”);
settextstyle(3,0,1);
outtextxy(getmaxy()/2-50,300,”COMPUTER GRAPHICS”);
outtextxy(getmaxx()-600,getmaxy()-140,”BY”);
outtextxy(getmaxx()-600,getmaxy()-110,”Archana Shrestha”);
outtextxy(getmaxx()-600,getmaxy()-80,”402/BEX/062″);
delay(2500);
cleardevice();
settextstyle(7,0,3);
outtextxy(getmaxx()/2-250,getmaxy()/2,”PROGRAM TO DRAW A BAR DIAGRAM”);
delay(1500);
input(sub1,sub2,sub3,sub4,sub5,sub6);
getch();
}
/*END OF MAIN PROGRAM*/
/*FUNCTION FOR READING DATA FROM USER */
void input(float sub1,float sub2 ,float sub3,float sub4,float sub5,float sub6)
{
cleardevice();
cout<“);
setcolor(12);
line(50,50,50,400);
line(50,400,600,400) ;
settextstyle(11,0,1);
outtextxy(70,430,”SUBJECT——->”);
setcolor(YELLOW);
settextstyle(2,0,2);
outtextxy(40,400,”00″);
outtextxy(40,380,”10″);
outtextxy(40,360,”20″);
outtextxy(40,340,”30″);
outtextxy(40,320,”40″);
outtextxy(40,300,”50″);
outtextxy(40,280,”60″);
outtextxy(40,260,”70″);
outtextxy(40,240,”80″);
outtextxy(40,220,”90″);
outtextxy(40,200,”100″);
setcolor(BLUE);
/* FUNCTION CALL TO DRAW BARDIAGRAM */
bar1(sub1);
bar2(sub2);
bar3(sub3);
bar4(sub4);
bar5(sub5);
bar6(sub6);
delay(3000);
cleardevice();
setbkcolor(1);
setcolor(5);
for (int j=0;j{
settextstyle(4,0,6);
setcolor(j);
delay(200);
outtextxy(getmaxx()/2-200,getmaxy()/2,” THANK-YOU “) ;
cout<
for(float i=0;i{
line(485,400-i,555,400-i);
delay(60);
}
}

About The Author

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top