Answer:
The two ways the calendar meets the criteria of showing the correct date are;
1) The calendar can give dates in the 12 months in a year
2) The calendar can show up to the 31 different days in a month
Explanation:
The two ways in which the calendar meets the criteria of showing the correct date are;
1) The number number of long blocks with 4 different months each = Three
Therefore, the total number of months the blocks can hold = 3 × 4 months = 12 months = The number of months in a year
2) The number of faces on each dice = 6 faces
The number of dice = 2 dice
The total number of faces = 12
The number of identical faces = 2 (11th and 22nd of the month)
The number of unique faces = 10
The number of combinations of the dices = ₁₀C₂ = 45
The number of combination of faces required to show = 1 to 31 = 31 combination
Therefore, there are adequate combinations on the dice to show all the dates of month
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:
Multitasking is a process in which we do multiple task at a time.
In computing system, multitasking is the concept of performing different types of multiple task and process over a certain period of time by executing simultaneously.
Operating system basically allow various task to run simultaneously by the user. In an operating system, each task consume storage system and all the other resources.
Multitasking function facilitate memory isolation in the processor and also supported different levels of security system in the operating system. For example, "a programmer working on any program in a system and as well as listening the music then, it perform multiple task at the same time".