The following cose will be used to copy assignment operator for CarCounter
<u>Explanation:</u>
Complete Program:
#include <iostream>
using namespace std;
class CarCounter
{
public:
CarCounter();
CarCounter& operator=(const CarCounter& objToCopy);
void SetCarCount(const int setVal)
{
carCount = setVal;
}
int GetCarCount() const
{
return carCount;
}
private:
int carCount;
};
CarCounter::CarCounter()
{
carCount = 0;
return;
}
// FIXME write copy assignment operator
/* Your solution goes here */
CarCounter& CarCounter::operator=(const CarCounter& objToCopy)
{
if(this != &objToCopy)
carCount = objToCopy.carCount;
return *this;
}
int main()
{
CarCounter frontParkingLot;
CarCounter backParkingLot;
frontParkingLot.SetCarCount(12);
backParkingLot = frontParkingLot;
cout << "Cars counted: " << backParkingLot.GetCarCount();
cout << endl << endl;
system("pause");
return 0;
}
Answer:
The code to this question can be given as:
Code:
int i,j,count_previous=0,count_next=0; //define variable
for (j=0; j<n; j++) //loop for array
{
if (x[0]==x[j]) //check condition
{
count_previous++; //increment value by 1.
}
}
for (i=0; i<n; i++) //loop
{
for (j=0; j<n; j++)
{
if (x[i]==x[j]) //check condition
{
count_next++; //increment value by 1.
}
}
if (count_previous>count_next) //check condition
{
mode=x[i-1];
}
else
{
mode=x[i];
count_previous=count_next; //change value.
count_next= 0 ; //assign value.
}
}
Explanation:
In the question it is define that x is array of the string elements that is already define in the question so the code for perform operation in the array is given above. In the code firstly we define the variable that is i, j, count_previous, count_next. The variable i,j is used in the loop and variable count_previous and count_next we assign value 0 that is used for check the values of array. Then we define the for loop in this loop we use conditional statement in the if block we check that array of zero element is equal to array of j value then the count_previous is increase by 1. Then we use nested loop It is also known as loop in a loop. In this first loop is used for array and the second loop is used for check array element.In this we use the condition that if array x of i value is equal to array x of j then count_next will increment by 1.Then we use another condition that is if count_previous is greater then count_next then mode of x is decrement by 1. else mode equal to array and count_previous holds the value of count_next and count_next is equal to 0.
Answer:
1. Microsoft Excel helps data analysis through different spreadsheet queries and operations options.
2. Input data to the analysis of sales by product is required for the development of formula and extracting results.
3. The information of data source and frequency of report is required to start the work.
Explanation:
1. Microsoft Excel tool can be used to calculate the results of equipment. Obtained results can be displayed in charts and graphs from the excel.
2. Information like the quantity of sold items, remaining items are required to produce accurate, useful analysis.
Before starting assignment accounting manager will be asked the following questions.
1) Where does the input data come from?
2) Is analysis required on a daily basis or once for all provided data?
3) Is Summary is in the form of tabular data, Graphical data, or Both?
Answer:
12/22
Explanation:
As there are 22 apples in total and 12 green it is 12/22.
Answer:
he should cite the websites of where he got his information.
Explanation: