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:
Store the following private members:
int id → sensor ID
int data[5] → fixed-size buffer
int count → number of stored samples (range: 0–5)
Provide:
A constructor that sets id and initializes count = 0
void addSample(int v)
If the buffer is full (count == 5), ignore the new value
Otherwise, store the value at index count and increment count
int size()
Returns the number of stored samples
void print()
Prints all stored samples in insertion order, space-separated