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

∙ 17y ago

What else can I help you with?

Continue Learning about Engineering

C program on left factoring in compiler design?

how to create a c program for left factoring.


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.


C program was introduced in the year?

c program was introduced in the year 1972 by Dennis RitchieNo, it was the C language, not the C program.


When was C-SPAN Bus program created?

C-SPAN Bus program was created in 1993.


What is C program execution life cycle?

C Program Development lifecycle!C Program Development CycleA C program typically passes through four steps of development.The solid lines show inputs into each step of the development cycle. Compile and Linkage Editor operations are performed by the C for AIX product, which also lets you specify what optional outputs are produced. Optional outputs are shown in the diagram by the broken lines. Descriptions of the steps follow below:Design and CodeInvolves designing a program to meet a specified requirement, and creating the programming language text files that will comprise the program source.CompileAfter checking for syntactical correctness, converts the programming language source files into machine readable instructions, where C variables are associated with memory addresses, and C statements are turned into a series of machine language instructions. The compiler can produces various forms of output, depending on the compiler options selected.Linkage EditorLinks compiler output with external modules requested by the compiled program. C programs can use routines from C libraries or any object or archive file from the IBM XL family of languages. C programs can also use modules produced by the current or previous compilations. As well as linking the external modules, the linkage editor resolves addresses within the object module.Run and TestThis stage can be both the final step in program development, or it can be an intermediate point in the program design and implementation process. A program's design commonly is further refined as a result of information gathered during testing.

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?


C program was introduced in the year?

c program was introduced in the year 1972 by Dennis RitchieNo, it was the C language, not the C program.


Features of c program?

the features of a C program


Is c graphics same as embedded c?

No. Embedded C refers to C used to program the computer in robots, microwaves, your car, etc. C graphics is very generic and can refer to 3D rendering or just making a GUI.


How do you display stars in c plus plus using the if else structure and a for loop and you use void main?

It depends on what program you design really