Example 1:
#include
#include
using namespace std;
class RAM
{
public:
string name;
int Price;
int Product_code;
string Brand;
void set_price(int new_price)
{
Price=new_price;
}
void name_edit(string new_name)
{
name=new_name;
}
};
int main()
{
RAM RAM1;
RAM1.Price=2200;
RAM1.Product_code=519;
RAM1.name="ADATA 4GB DDR3 1600 BUS";
RAM1.Brand="ADATA";
//change ram 1 value
RAM1.name="ADATA 4GB DDR9 1600 BUS";
cout< cout< cout< cout< } Example 2:--------------------------------------------------------------------> #include #include using namespace std; class RAM { public: string name; int Price; int Product_code; string Brand; void set_price(int new_price) { Price=new_price; } void name_edit(string new_name) { name=new_name; } }; int main() { RAM RAM1; RAM1.Price=2200; RAM1.Product_code=519; RAM1.name="ADATA 4GB DDR3 1600 BUS"; RAM1.Brand="ADATA"; RAM1.name="ADATA 4GB DDR9 1600 BUS"; cout< cout< cout< cout< }
thistimebd Bangladesh Live online newsportal, education, Lifestyle, Health, Photography, gif image etc.
Make your own name or company name website | contact: thistimebd24@gmail.com
Copyright © 2020-2025 News Portal in Bangladesh - THISTIMEBD.COM. ALL Rights Reserved.