21 lines
411 B
C++
21 lines
411 B
C++
#include <string>
|
|
#include <iostream>
|
|
using namespace std;
|
|
|
|
class Stock
|
|
{
|
|
public:
|
|
void buy()
|
|
{
|
|
cout << "Stock [ Name: " + name + ", Quantity: " + std::to_string(quantity) + " ] bought" << endl;
|
|
}
|
|
void sell()
|
|
{
|
|
cout << "Stock [ Name: " + name + ", Quantity: " + std::to_string(quantity) + " ] sold" << endl;
|
|
}
|
|
|
|
private:
|
|
string name = "test";
|
|
int quantity = 10;
|
|
};
|