Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Flight
- {
- private:
- int passenger_fee[10],total=0;
- public:
- void getincome();
- displayincome();
- };
- void Flight::getincome()
- {
- for(int x=1;x<=10;x++)
- {
- cout<<x<<" Passenger Fee :-"<<endl;
- cin>>passenger_fee[x];
- total=+passenger_fee[x];
- }
- }
- Flight::displayincome()
- {
- cout<<"Total income of all passengers: "<<total<<endl;
- }
- int main()
- {
- Flight O1;
- Flight O2;
- O1.getincome();
- O2.displayincome();
- return 0;
- }
Add Comment
Please, Sign In to add comment