TAB

One of the works done by our Robotics and Machine Learning division,
SELF-LEVELING QUADCOPTER
Arduino based Quadcopter.
Self-leveling is acheived by the aligning the quadcopter using the readings from the gryo as well as the accelerometer.
A four channel RC transmitter is used to control the movement of the quadcopter when in flight. Kindly subscribe to our YouTube Channel and stay tuned.

Wednesday 23 March 2016

PRACTICE PROBLEM 5 : COINS

====================================

=======================================
void coin::get()
{
cin>>weight;
cin>>curr_X;
cin>>curr_Y;
}
void coin::print()
{
cout<<weight<<endl;
}
int coin::get_Curr_X()
{
return curr_X;
}
int coin::get_Curr_Y()
{
return curr_Y;
}
int coin::get_Weight()
{
return weight;
}
class black_Coin:public coin
{
int moves;
public:
void get()
{
coin::get();
cin>>moves;
}
void print()
{
coin::print();
}
void move()
{
cout<<curr_X<<","<<curr_Y+1;
}
int gained_Power()
{
if(moves>=5)
return 1;
else
return 0;
}


};
class red_Coin:public coin
{
public:
void get()
{
coin::get();
}
void print()
{
coin::print();
}
void move()
{
cout<<curr_X-1<<","<<curr_Y<<endl;
cout<<curr_X+1<<","<<curr_Y<<endl;
cout<<curr_X<<","<<curr_Y-1<<endl;
cout<<curr_X<<","<<curr_Y+1<<endl;
cout<<curr_X-1<<","<<curr_Y-1<<endl;
cout<<curr_X+1<<","<<curr_Y-1<<endl;
cout<<curr_X-1<<","<<curr_Y+1<<endl;
cout<<curr_X+1<<","<<curr_Y+1<<endl;
}
void set_Curr_Pos_Wt(black_Coin b)
{
weight=b.get_Weight();
curr_X=b.get_Curr_X();
curr_Y=b.get_Curr_Y();
}



};

No comments:

Post a Comment