Guest User

Untitled

a guest
Nov 22nd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. class Flight
  2. {
  3. private:
  4. int passenger_fee[10],total=0;
  5. public:
  6. void getincome();
  7. displayincome();
  8. };
  9. void Flight::getincome()
  10. {
  11. for(int x=1;x<=10;x++)
  12. {
  13. cout<<x<<" Passenger Fee :-"<<endl;
  14. cin>>passenger_fee[x];
  15. total=+passenger_fee[x];
  16. }
  17. }
  18. Flight::displayincome()
  19. {
  20. cout<<"Total income of all passengers: "<<total<<endl;
  21. }
  22. int main()
  23. {
  24. Flight O1;
  25. Flight O2;
  26. O1.getincome();
  27. O2.displayincome();
  28. return 0;
  29. }
Add Comment
Please, Sign In to add comment