I am currently doing classes, but I am unable to print out my cout statements in the "elmo.modifyALL" function. I can get the other stuff to print correctly so far. This is my first time doing this kind of program, so I do not understand why I can't get cout statements in the "elmo.modifyALL" function to print out. Thanks
.h file:
class toyType
{
public:
void print() const;
void modifyALL(string m, double c, int stoc);
toyType(string m, double c, int stoc);
toyType();
private:
string toyname;
double cost;
int stockcount;
};
void toyType::print()const
{
cout<<"Toyname"<<" Cost "<<"Stock Count"<<endl;
cout<<toyname<<" $ "<<cost<<" "<<stockcount<<endl;
}
toyType::toyType(string m, double c, int stoc)
{
toyname = m;
cost = c;
stockcount = stoc;
}
toyType::toyType()
{
toyname = "Unknown";
cost = 0;
stockcount = 0;
}
void elmo::modifyALL()
{
cout<<"Enter new information below..."<<endl;
cout<<"Enter Toy name: "<<endl;
cin>>toyname;
cout<<"Enter Cost of toy: "<<endl;
cin>>cost;
cout<<"Enter number in stock: "<<endl;
cin>>stockcount;
}
.cpp file:
#include <iostream>
#include <iomanip>
using namespace std;
#include "Unknown.h"
int main()
{
toyType ps3("Playstation 3",500,2000);
toyType elmo;
ps3.print();
elmo.print();
elmo.modifyAll();
// ps3.sale(2);
elmo.print();
ps3.print();
system ("PAUSE");
return 0;
}