Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

Solar System CGR22318, Sem III

PART-A PLAN

1.0 Brief Introduction


__________________________________________________
__

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.

2.0 AIM of Micro-Project


__________________________________________________
__

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

3.0 Action Plan


__________________________________________________
__

Sr. Details of Activity Planned Planned Name of Responsible Team


No Start Finish Members
Date Date
1 Project selection

2 Identifying project
outcomes

3 Identifying resources
required

4 Algorithm &
implementation

5 Final outcome

6 Documentation

7 Seminar and viva-vose

8 Final submission of Micro


project

2
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem III

4.0 Resources Required


__________________________________________________
__

Sr. No Name of Specification Qty Remarks


Resource

1 Computer 500GB HDD, 1


4 Gb RAM,
AMD processor,
Windows 7 OS
2 Turbo C - 1

3
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem III

PART-B OUTCOME

1.0 Brief Description


__________________________________________________
__

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.

2.0 AIM of Micro-Project


__________________________________________________
__

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.

3.0 Course Outcomes (CO)


__________________________________________________
__

4
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem III

a. a. Implement standard algorithm to draw various Flying Plane by using C


program.

4.0 Procedure Followed


__________________________________________________
__

Algorithm:

Step 1: Start

Step 2: Initialize

Step 3: Initialize get max x and get max y

Step 4: Use for loop for the moment of shapes, for (i=360; i<0; i=i-6)

Step 5: Use pieslice command to draw shapes

Step 6: Use setcolor, setfillstyle and floodfill command to insert color in


respective shapes
Step 7: Use delay function for delay of the for loop, delay (100)

Step 8: Display output of solar system

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

int Xrad, int Yrad, int midx,


int middy, int x[60], int y[60]

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 gdriver = DETECT, gmode, errorcode; // request auto detection

int i,k;

// initialize graphics and local variables

initgraph(&gdriver, &gmode,"c:\\tc\\bgi");

// read result of initialization

errorcode = graphresult();

9
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem III

// an error occurred

if (errorcode != grOk)

printf("Graphics error: %s\n", grapherrormsg(errorcode));

printf("Press any key to halt:");

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

5.0 Resources Used


__________________________________________________
__

Sr. No Name of Specification Qty Remarks


Resource

1 Computer 500GB HDD, 1


4 Gb RAM,
AMD processor,
Windows 7 OS
2 Turbo C - 1

15
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem
III

6.0 Outputs of Micro-Projects

__________________________________________________
__

Output:

7.0 Skill Developed

16
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem
III

__________________________________________________
__

Thus, I have implemented a C program using computer graphics to Flying Plane


S

17
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Solar System CGR22318, Sem
III

18
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.

You might also like