Object of Chair Containing Attributes and Behaviors
Object of Chair Containing Attributes and Behaviors:
A simple object in C++ Programming using classes containing attributes and behaviors. Attributes are declared in private variables and behaviors are declared in user defined functions in public inside the class of chair
Code of the object of Chair:
#include<iostream> #include<string> using namespace std; class chair{ //attributes string c_name; string colour; //behaviour public: void inputdetail(){ cin>>c_name; cin>>colour; } void displaydetail(){ cout<<c_name<<" "<<colour<<" "<<endl; }
};
.................................................To get the full code see at the end of the article.
Download:
To download this code click on the given link below:
Comments
Post a Comment