//============================================================================ // Name : ClassIntroduction.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include #include using namespace std; class Sushi { private: string name; int rice; int size; public: void makebig() { size++; } string getName() { return name; } void setName(string NewName) { this->name = NewName; } int getRice() { return rice; } void setRice(int rice) { this->rice = rice; } int getSize() { return size; } void setSize(int MySize) { size = MySize; } }; int main() { Sushi s1, s2, s3; s1.setName("Salmon"); s2.setName("Tuna"); s1.setSize(3); cout << "First piece is " << s1.getName() << endl; cout << "Size = " << s1.getSize() << endl; s1.makebig(); cout << "Size = " << s1.getSize() << endl; return 0; }