Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started