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.

Tuesday 8 March 2016

PRACTICE PROBLEM 4: passenger


     #include<iostream>
using namespace std;
class passenger
{
string name;
int x;
int age;
string Address;
string date;
string mobile;
int fare;
public:
void get();
void disp();
friend void discount(passenger &p);
};
void passenger::get()
{
cin>>name;
cin>>x;
cin>>age;
cin>>Address;
cin>>date;
cin>>mobile;
cin>>fare;
}
void passenger::disp()
{

cout<<name<<endl;
cout<<"CA"<<x<<endl;
cout<<age<<endl;
cout<<date<<endl;
cout<<mobile<<endl;
cout<<fare<<endl;
}
void discount(passenger &p)
{
if(p.age<12)
p.fare-=p.fare/2;
else if(p.age<58)
p.fare-=p.fare/5;
else
p.fare-=p.fare*2/5;
}
int main()
{
passenger p;
p.get();
discount(p);
p.disp();
return 0;
}

No comments:

Post a Comment