Answer:
Do you want me the money for the policy that has been canceled
Answer:
Huffman code is use for encoding the language. The entropy when calculated is 1.5.
Explanation:
Using Huffman Coding scheme to encode:
The huffman coding scheme is described in the attachment.
To find entropy; we use the formula given below:
H = ∑
where H = Entropy and p = probability
p(A) = 50% = 1/2
p(B) = 25% = 1/4
p(C) = 25% = 1/4

#include <iostream>
using namespace std;
class CarCounter {
public:
CarCounter();
CarCounter(const CarCounter& origCarCounter);
void SetCarCount(const int count) {
carCount = count;
}
int GetCarCount() const {
return carCount;
}
private:
int carCount;
};
CarCounter::CarCounter() {
carCount = 0;
return;
}
CarCounter::CarCounter(const CarCounter &p){
carCount = p.carCount;
}
void CountPrinter(CarCounter carCntr) {
cout << "Cars counted: " << carCntr.GetCarCount();
return;
}
int main() {
CarCounter parkingLot;
parkingLot.SetCarCount(5);
CountPrinter(parkingLot);
return 0;
}
Sample output:
Cars Counted: 5
Answer:
The output of the first question would be 9. And the answer the second question is 10.