Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <string>
- #include <vector>
- using namespace std;
- class product
- {
- public :
- int prodid;
- string description;
- double price;
- product(){};
- product(int id,string d,double p)
- {
- prodid = id;
- description = d;
- price = p;
- }
- void show()
- {
- cout<<prodid<<" "<<description<< " "<<price<<endl;
- }
- };
- int main()
- {
- product m[3];
- for (int i=0;i<3;i++)
- {
- cout <<"enter the product " <<endl;
- cin>>m[i].prodid>>m[i].description>>m[i].price;
- }
- for (int i=0;i<3;i++)
- {
- m[i].show();
- }
- system("pause");
- }
Add Comment
Please, Sign In to add comment