Define a class UartConfig that represents configuration parameters of a UART peripheral in an embedded system.
Your class must:
int baudrateint parity0 = none1 = even2 = oddint stopBits1 or 2void update(int b, int p, int s) which updates all configuration fields.void print() which prints the configuration exactly in the format:baud=<value> parity=<value> stop=<value>
main():b1 p1 s1 representing the initial UART configuration.b2 p2 s2 representing the updated UART configuration.UartConfig object using the initial values.print().Example Input:
9600 0 1 115200 1 1 Example Output:
baud=115200 parity=1 stop=1 Constraints:
update() method must be used to modify the configuration.print() must produce exactly the required output format.cin / cout) only.
Input
9600 0 1 115200 1 1
Expected Output
baud=115200 parity=1 stop=1