#include <iostream> using namespace std; class UART { public: // your code here: define constructor with parameters baudRate and parity int baud{0}; char parity; UART(int baudRate, char parity) { baud = baudRate; this->parity = parity; cout<<"UART initialized with baud="<<this->baud<<", parity="<<this->parity<<endl; } }; int main() { UART u(9600, 'N'); return 0; }
Test Cases
Test Results
Input
Expected Output
UART initialized with baud=9600, parity=N