Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- class Animal
- {
- private:
- std::string Color;
- std::string Size;
- public:
- void setColor(std::string a)
- {
- Color = a;
- };
- void setSize(std::string b)
- {
- Size = b;
- }
- std::string getColor()
- {
- return Color;
- }
- std::string getSize()
- {
- return Size;
- }
- };
- int main()
- {
- Animal dogColor;
- Animal dogSize;
- dogColor.setColor("Brown");
- dogSize.setSize("Large");
- std::cout << "You have a " << dogSize.getSize() << ", "<< dogColor.getColor() << " dog!";
- return 0;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement