To Compile
- I used gcc version 12.1.0 supporting c++20 .....
- open terminal and navigate to the project directory.
- compile using the command:
g++ -std=c++20 -o main main.cpp
. - Run the executable
[1] Problems Identified
- iostream header not included
- std::optional not included
- remove() and remove_if() not members of therefore included std::algorithm - ref https://en.cppreference.com/w/cpp/algorithm/ranges/remove
[2] Implementing Phantom Power Feature
- added a boolean member to device class - "phantomPowerStatus"
- added setter and getter (as string to be displayed - for the sake of clarity for the user)
- inside runApp() method added set-phantom-power to list of commands displayed to user
- also added line to show phantom-power when user runs the command 'status'
- processed command input by user inside processDeviceCommand() method
[3] Ensuring Preamp level in range
-
just a simple if, else statement to check - inside setPreampLevel method
-
also added try catch block inside processCommand to ensure non-numerical values for preamp values are handled