Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. /******************************************************************************
  2.  
  3. Online C++ Compiler.
  4. Code, Compile, Run and Debug C++ program online.
  5. Write your code in this editor and press "Run" button to compile and execute it.
  6.  
  7. *******************************************************************************/
  8.  
  9. //---------------------------------------------------------------------------
  10. #include <conio.h>
  11. #include <iostream>
  12. #include <stdlib.h>
  13. #include <stdio.h>
  14. #pragma hdrstop
  15. //---------------------------------------------------------------------------
  16.  
  17. #pragma argsused
  18. class vehiculo
  19. {
  20. private:
  21. char placa[10];
  22. char dueno[50];
  23. int pasajeros;
  24. public:
  25. int getPasajeros ()
  26. {
  27. return pasajeros;
  28. }
  29. void setPasajeros (int c)
  30. {
  31. pasajeros = c;
  32. }
  33. };
  34.  
  35. using namespace std;
  36.  
  37. int main ()
  38. {
  39. vehiculo carro;
  40. carro.setPasajeros (4);
  41. cout << "Pasajeros: " << carro.getPasajeros () << endl;
  42. getch ();
  43. return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement