#include (iostream.hpp)
class Stocks { public: Stocks( int price); ~Stocks(); int get_price() const {return pps;} int set_price() const {pps;} int the_price_is (int pps); int pps; } int main() { Stocks AMX (35) cout << " Hello, please enter a symbol.\n"; if cin>> AMX; cin.ignore; cin.get; AMX.the_price_is cout<<" 35.\n"; return 0; } Well, I know this is not the right way to do this but here is the problem. When I tried to put in the constructor and destructor, they caused alot more errors. But also it says I can't declare a new class, whcih I am not, the only thing I am creating is an object (AMX, the stock symbol for American Express). So how do I implement this code? And one unrrelated question: what does it mean by keeping this place student friendly? Does it mean don't expect people to create code for you? Thanks[code=C++]#include (iostream.hpp)
class Stocks
{
public:
Stocks( int price);
~Stocks();
int get_price() const {return pps;}
int set_price() const {pps;}
int the_price_is (int pps);
int pps;
}
int main()
{
Stocks AMX (35)
cout << " Hello, please enter a symbol.\n";
if
cin>> AMX;
cin.ignore;
cin.get;
AMX.the_price_is
cout<<" 35.\n";
return 0;
}
Well, I know this is not the right way to do this but here is the problem. When I tried to put in the constructor and destructor, they caused alot more errors. But also it says I can't declare a new class, whcih I am not, the only thing I am creating is an object (AMX, the stock symbol for American Express). So how do I implement this code? And one unrrelated question: what does it mean by keeping this place student friendly? Does it mean don't expect people to create code for you? Thanks