Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <sstream>
  4. using namespace std;
  5.  
  6.  
  7.  
  8. int main(){
  9.  
  10. class Locomotief{
  11. public:
  12. float maxTrekkracht;
  13. string type;
  14. private:
  15. float getMaxTrekkracht(){
  16. return maxTrekkracht;
  17. }
  18. void setMaxTrekkrachht(float nieuweMaxTrekkracht){
  19. maxTrekkracht = nieuweMaxTrekkracht;
  20. }
  21. string getType(){
  22. return type;
  23. }
  24. void setType(string nieuwType){
  25. type = nieuwType;
  26. }
  27. Locomotief(float maxTrekkracht, string type){
  28. maxTrekkracht = maxTrekkracht;
  29. type = type;
  30. }
  31. ~Locomotief(){
  32. cout << "Locomotief wordt verwijderd";
  33. }
  34. string toString(){
  35. stringstream ss;
  36. ss << "Naam van de locomotief?\n" << type << "\nTrekkracht van de locomotief?\n" << maxTrekkracht << endl;
  37. return ss.str();
  38. }
  39. };
  40.  
  41. class Wagon{
  42. public:
  43. int maxGewicht;
  44. private:
  45. int getMaxGewicht(){
  46. return maxGewicht;
  47. }
  48. void setMaxGewicht(int nieuwMaxGewicht){
  49. maxGewicht = nieuwMaxGewicht;
  50. }
  51. Wagon(int maxGewicht){
  52. maxGewicht = maxGewicht;
  53. }
  54. ~Wagon(){
  55. cout << "Wagon wordt verwijderd";
  56. }
  57. string toString(){
  58. stringstream ss;
  59. ss << "Gewicht van de wagon: " << maxGewicht << endl;
  60. return ss.str();
  61. }
  62. };
  63.  
  64. class Trein{
  65. public:
  66. Locomotief locomotief1;
  67. locomotief1.type = "The Rocket";
  68. locomotief1.maxTrekkracht = 100;
  69. private:
  70. bool toevoegenWagon(){
  71.  
  72. }
  73. bool verwijderenWagon(){
  74.  
  75. }
  76. };
  77.  
  78. return 0;
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement