Question: In the Store class, complete the function definition for SetNumSold ( ) with the integer parameter customNumSold. Ex: If the input is 4 1 6
In the Store class, complete the function definition for SetNumSold with the integer parameter customNumSold.
Ex: If the input is then the output is:
Years open:
Number of items sold:
#include
using namespace std;
class Store
public:
void SetYearsOpenint customYearsOpen;
void SetNumSoldint customNumSold;
int GetYearsOpen const;
int GetNumSold const;
private:
int yearsOpen;
int numSold;
;
void Store::SetYearsOpenint customYearsOpen
yearsOpen customYearsOpen;
void Store::SetNumSoldint customNumSold
numSold customNumSold;
int Store::GetYearsOpen const
return yearsOpen;
int Store::GetNumSold const
return numSold;
int main
Store store;
int inputYearsOpen;
int inputNumSold;
cin inputYearsOpen;
cin inputNumSold;
storeSetYearsOpeninputYearsOpen;
storeSetNumSoldinputNumSold;
cout "Years open: storeGetYearsOpen endl;
cout "Number of items sold: storeGetNumSold endl;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
