Create a class SensorBuffer that stores up to 5 sensor samples (integers).
This simulates a fixed-size sample buffer commonly used in embedded firmware where memory is limited.
Your class must:
int id → sensor IDint data[5] → fixed-size bufferint count → number of stored samples (range: 0–5)id and initializes count = 0void addSample(int v)count and increment countint size()void print()main():idn (number of incoming samples)n integer samplesaddSample()print()Example Input:
42
7
10 20 30 40 50 60 70
Example Output:
10 20 30 40 50
Why?
Constraints:
Input
42 7 10 20 30 40 50 60 70
Expected Output
10 20 30 40 50