13. UART Configuration Class

 Frame a class UART with the following:

  • Private data members:
    • baudRate (integer)
    • parity (character: 'N' = None, 'E' = Even, 'O' = Odd)
  • Public methods:
    • Constructor UART(int baudRate, char parity) → initializes both members

 

void showConfig() const → prints the UART configuration in the format:

 Baud=<baudRate> Parity=<parity>

The input will contain two values:

  • baudRate, parity

     

Example
 Input:

9600 N

 Output:

Baud=9600 Parity=N

Here, baudRate = 9600, parity = N.

 

Input:

115200 E

 Output:

Baud=115200 Parity=E

Here, baudRate = 115200, parity = E.

Loading...

Input

9600 N

Expected Output

Baud=9600 Parity=N