answersLogoWhite

0

#include<stdio.h>

#include<graphics.h>

#include<math.h>

#include<conio.h>

#include<dos.h>

#include<alloc.h>

#include<stdlib.h>

#define RAD 3.141592/180

class fig

{

private:

int x1,x2,y1,y2,xinc,yinc;

public:

void car()

{ xinc=10;yinc=10;

x1=y1=10;

x2=x1+90;y2=y1+35;

int poly[]={x1+5,y1+10,x1+15,y1+10,x1+20,y1,x1+50,y1,x1+60,y1+10,x1+90,y1+17,x1+90,y1+20,x1+5,y1+20,x1+5,y1+10};

setfillstyle(SOLID_FILL,LIGHTGRAY);

setlinestyle(SOLID_LINE,1,2);

setcolor(4);

drawpoly(9,poly);

line(x1+15,y1+10,x1+60,y1+10);

line(x1+20,y1+10,x1+20,y1);

line(x1+35,y1+10,x1+35,y1);

line(x1+50,y1+10,x1+50,y1);

floodfill(x1+18,y1+8,4);

floodfill(x1+28,y1+8,4);

floodfill(x1+36,y1+8,4);

floodfill(x1+52,y1+8,4);

setfillstyle(SOLID_FILL,4);

floodfill(x1+18,y1+12,4);

setfillstyle(SOLID_FILL,BLUE);

bar(x1+5,y1+20,x1+90,y1+25);

setcolor(DARKGRAY);

circle(x1+20,y1+25,8);

circle(x1+20,y1+25,6);

setfillstyle(1,8);

floodfill(x1+21,y1+25,8);

circle(x1+70,y1+25,8);

circle(x1+70,y1+25,6);

floodfill(x1+71,y1+25,8);

int size=imagesize(x1,y1,x2,y2);

void far *buf=farmalloc(size);

getimage(x1,y1,x2,y2,buf);

while(!kbhit())

{ putimage(x1,y1,buf,XOR_PUT);

x1+=xinc;x2+=xinc;

if(x2<(getmaxx()-10))

putimage(x1,y1,buf,COPY_PUT);

else

{ cleardevice();

x1=10;x2=x1+90;

y1+=yinc;y2+=yinc;

if(y2<(getmaxy()-10))

{ putimage(x1,y1,buf,COPY_PUT);

}

else {y1=10;y2=y1+35;}

}

delay(200);

}

farfree(buf);

getch();

}

}

}

}

void main()

{

int gd=DETECT,gm;

initgraph(&gd,&gm,"d:\\cplus");

fig f;

f.car();

cleardevice();

closegraph();

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

C program on left factoring in compiler design?

how to create a c program for left factoring.


How do you write a c program to design calculator using loop?

Wr


How do you design a computer using c plus plus?

C++ is used to write programs, not to design computers. If you want to design computers, use a CAD program specifically intended to aid in electronics design.


How there is security in c language?

The c language is as secure or as insecure as the programmer makes it. Security is not in the language; it is in the design of the program.


Is there a program that lets you design your own car on gran truismo 4?

no but try searching up car customisation down loader


Where can someone purchase car design software?

Software specially created for car design can be found at many software retailers online and in stores. Adobe has a car design program, AutoDesk specializes in computer-aided design programs for professionals, and Google SketchUp offers a free alternative for amateur designers.


Can visual basic compile a c plus plus program?

As much as your car can fly.


3 If a software design is not a program and it isn't then what is it?

If a software design is not a program (and it isn't), then what is it?


When was Stanford Joint Program in Design created?

Stanford Joint Program in Design was created in 1958.


Difference between top down program design and bottom up program design?

Top down Program Design : Begins the design with main or top-level module, and progresses downwards to the lowest level modules or subsystem Bottom down Program Design : Begins the design with the lowest level modules or subsystems, and progresses upward to the main program, module or subsystem.


When creating a computer program who is design the structure of the program in a computer system?

when creating a computer program, system analyst design the structure of the program


Features of c program?

the features of a C program