Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- class Sandwich {
- string sand;
- public:
- int MakeMeOne(string);
- int EatIt();
- };
- int main () {
- string x;
- cout << "What do you want your sandwich to taste like?" << endl;
- cin >> x;
- Sandwich Sandvich;
- Sandvich.MakeMeOne(x);
- x = Sandvich.EatIt();
- cout << "That was one " << x << " sandwich!";
- return 0;
- }
- Sandwich::MakeMeOne(string numster){
- sand = numster;
- return 0;
- }
- Sandwich::EatIt(){
- return sand;
- }
Add Comment
Please, Sign In to add comment