Tuesday, July 26, 2011

Moving a Car in C++


#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<stdlib.h>'
#include<dos.h>
class Car
{
public:
void design();
};
void Car::design()
{
for(int i=1;i<=448;i++)
{
cleardevice();
arc(100+i,200,0,180,50);
line(120+i,200,120+i,155);
line(121+i,200,121+i,155);
line(80+i,200,80+i,155);
line(79+i,200,79+i,155);
line(50+i,200,150+i,200);
line(10+i,240,35+i,240);
line(190+i,240,165+i,240);
line(65+i,240,135+i,240);
arc(50+i,240,90,180,40);
arc(150+i,240,0,90,40);
circle(50+i,240,5);
circle(50+i,240,15);
circle(150+i,240,5);
circle(150+i,240,15);
delay(5);
}
}
void main()
{
clrscr();
Car obj;
int gdriver = DETECT, gmode;
initgraph(&gdriver, &gmode, "");
obj.design();
getch();
}

9 comments:

  1. program run properly but screen doesn't hold

    help me sir

    ReplyDelete
  2. mere compiler me run nhi horaha hain plz give me solution

    ReplyDelete
  3. how to include graghics? please help me

    ReplyDelete
  4. program is not working koi bhi output nahi araha hai

    ReplyDelete
  5. Please can you explain the code

    ReplyDelete
  6. mera output nhi aa raha hai

    ReplyDelete
  7. The physics questions like a motor car moving at a speed of 15 kms should stop after traveling 50 meters without applying brakes.

    ReplyDelete
  8. Tumh muze yhi project krna aahe ..
    Plzz send mi introduction flowchart etc etc.... Related to project option

    ReplyDelete

Please put your valuable comments