Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <sstream>
- using namespace std;
- int main(){
- class Locomotief{
- public:
- float maxTrekkracht;
- string type;
- private:
- float getMaxTrekkracht(){
- return maxTrekkracht;
- }
- void setMaxTrekkrachht(float nieuweMaxTrekkracht){
- maxTrekkracht = nieuweMaxTrekkracht;
- }
- string getType(){
- return type;
- }
- void setType(string nieuwType){
- type = nieuwType;
- }
- Locomotief(float maxTrekkracht, string type){
- maxTrekkracht = maxTrekkracht;
- type = type;
- }
- ~Locomotief(){
- cout << "Locomotief wordt verwijderd";
- }
- string toString(){
- stringstream ss;
- ss << "Naam van de locomotief?\n" << type << "\nTrekkracht van de locomotief?\n" << maxTrekkracht << endl;
- return ss.str();
- }
- };
- class Wagon{
- public:
- int maxGewicht;
- private:
- int getMaxGewicht(){
- return maxGewicht;
- }
- void setMaxGewicht(int nieuwMaxGewicht){
- maxGewicht = nieuwMaxGewicht;
- }
- Wagon(int maxGewicht){
- maxGewicht = maxGewicht;
- }
- ~Wagon(){
- cout << "Wagon wordt verwijderd";
- }
- string toString(){
- stringstream ss;
- ss << "Gewicht van de wagon: " << maxGewicht << endl;
- return ss.str();
- }
- };
- class Trein{
- public:
- Locomotief locomotief1;
- locomotief1.type = "The Rocket";
- locomotief1.maxTrekkracht = 100;
- private:
- bool toevoegenWagon(){
- }
- bool verwijderenWagon(){
- }
- };
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement