Question: In the Business class, complete the function definition for SetYearsOpen ( ) with the integer parameter newYearsOpen. Ex: If the input is 1 5 6
In the Business class, complete the function definition for SetYearsOpen with the integer parameter newYearsOpen.
Ex: If the input is then the output is:
Items in stock:
Number of items sold:
Years open:
#include
using namespace std;
class Business
public:
void SetNumStockint newNumStock;
void SetNumSoldint newNumSold;
void SetYearsOpenint newYearsOpen;
int GetNumStock const;
int GetNumSold const;
int GetYearsOpen const;
private:
int numStock;
int numSold;
int yearsOpen;
;
void Business::SetNumStockint newNumStock
numStock newNumStock;
void Business::SetNumSoldint newNumSold
numSold newNumSold;
Your code goes here
yearsOpen newYearsOpen;
int Business::GetNumStock const
return numStock;
int Business::GetNumSold const
return numSold;
int Business::GetYearsOpen const
return yearsOpen;
int main
Business business;
int userNumStock;
int userNumSold;
int userYearsOpen;
cin userNumStock;
cin userNumSold;
cin userYearsOpen;
businessSetNumStockuserNumStock;
businessSetNumSolduserNumSold;
businessSetYearsOpenuserYearsOpen;
cout "Items in stock: businessGetNumStock endl;
cout "Number of items sold: businessGetNumSold endl;
cout "Years open: businessGetYearsOpen endl;
return ;
in c
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
