Professional Documents
Culture Documents
CGR Report1 (3), MAIN
CGR Report1 (3), MAIN
PART-A PLAN
In this project, I had designed a C program to show Flying Plane. This project
is made using C programming language on turbo C++. It consists of header
files such as stdio.h, conio.h, graphics.h, dos.h. The first two header files are
commonly used in a C programming language, the graphics file is used for
animation purpose and dos one is used for working purpose of delay( ) used in
the code. Graphics driver and graphics mode is used to initialize graph and in
the double inverted marks we had provided the path.
The aim of this project is to design the C program for showing an Flying Plane
in the output by applying simple concepts of computer graphics and to clearly
understand topics about the subject.
1
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem III
2 Identifying project
outcomes
3 Identifying resources
required
4 Algorithm &
implementation
5 Final outcome
6 Documentation
2
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem III
3
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem III
PART-B OUTCOME
In this project, I had designed a C program to show Flying Plane. This project is
made using C programming language on turbo C++. It consists of header files such
as stdio.h, conio.h, graphics.h, dos.h. The first two header files are commonly used
in a C programming language, the graphics file is used for animation purpose and
dos one is used for working purpose of delay( ) used in the code. Graphics driver
and graphics mode is used to initialize graph and in the double inverted marks we
had provided the path.. The main purpose of designing was to show animated
Flying Plane with the help of C language.
The aim of this project is to design the C program for showing an animated
Flying Plane .in the output by applying simple concepts of computer graphics
and to clearly understand topics about the subject.
4
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem III
Algorithm:
Step 1: Start
Step 2: Initialize
Step 4: Use for loop for the moment of shapes, for (i=360; i<0; i=i-6)
Step 9: Stop
5
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem III
Flow Chart:
6
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem III
Start
for(i=1;i<getmaxcolor();i++)
[3])
,y
o
[7])
7
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem III
setcolor(i);
drawplane(i);
outtextxy(420,220,"AIR");
outtextxy(450,218,"INDIA");
setcolor(11);
outtextxy(285,400,"Made BY---");
outtextxy(400,400,"36-40");
setcolor(i);
drawplane(i);
Display output of Flying Plane
outtextxy(420,220,"AIR");
outtextxy(450,218,"INDIA");
setcolor(11);
outtextxy(285,400,"Made BY---");
Stop
outtextxy(400,400,"36-40");
8
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem III
Code:
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <dos.h>
void drawplane(int);
int main(void)
int i,k;
initgraph(&gdriver, &gmode,"c:\\tc\\bgi");
errorcode = graphresult();
9
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem III
// an error occurred
if (errorcode != grOk)
getch();
exit(1);
//diagram
for(i=1;i<getmaxcolor();i++)
setcolor(i);
drawplane(i);
outtextxy(420,220,"AIR");
outtextxy(450,218,"INDIA");
setcolor(11);
outtextxy(285,400,"Made BY---");
outtextxy(400,400,"36-40");
10
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem III
for(k=0;k<900;k++)
setcolor(random(15));
outtextxy(random(k),random(175),".");
delay(800);
cleardevice();
// clean UP
getch();
closegraph();
return 0;
void drawplane(int n)
int i,j,k;
11
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem III
int poly[30];
line(145,220, 475,175);
arc(470,205,20,90,30);
ellipse(500,210, 270,95,15,15);
line(200,260,265,250);
line(350,240,500,225);
line(350,240,200,375);
line(200,375,175,380);
line(175,380,270,270);
line(270,270,270,260);
line(270,260,260,240);
line(260,240,340,230);
line(340,230,350,240);
line(340,230,195,375);
line(200,260,100,250);
line(100,250,100,230);
line(100,230,110,220);
12
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem III
line(110,225,90,150);
line(90,150,110,150);
line(110,150,150,225);
line(150,225,110,225);
line(95,170,105,170);
line(105,170,130,225);
line(105,245,60,275);
line(60,275,75,275);
line(75,275,150,245);
line(150,245,105,245);
line(115,245,65,275);
for(i=0,j=200,k=235;i<12;i++)
setcolor(n);
rectangle(j,k,j+10,k+5);
j=j+20;
if(j>200)
13
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem III
k=k-3;
setcolor(n);
rectangle(400,205,410,230);
poly[0]=487;
poly[1]=180;
poly[2]=470;
poly[3]=180;
poly[4]=475;
poly[5]=190;
poly[6]=495;
poly[7]=190;
drawpoly(4,poly);
14
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem
III
15
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem
III
__________________________________________________
__
Output:
16
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem
III
__________________________________________________
__
17
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem
III
18
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.