It is recommended to use the following alias for compiling the labs:
alias w++17="g++ -std=c++17 -Wall -Wextra -Wpedantic -Weffc++ -Wold-style-cast"both g++ and clang++ works with this alias.
Compile the testing framework which should yields a precompiled object file test_main.o
w++17 -c test_main.cppCompile the test with the precompiled object file
w++17 test_main.o Time.cpp time_test.cppCompile the testing framework which should yields a precompiled object file test_main.o
w++17 -c test_main.cppCompile the lab:
w++17 Battery.cpp Capacitor.cpp Component.cpp Connection.cpp Network.cpp Resistor.cpp main.cppCompile the lab:
w++17 main.cppRun the program
./a.out <input file> FLAGS
FLAGS:
--print Prints every word in <input file> separated by spaces
--frequency Prints frequency table of <input file> in descending order of occurance
--table Prints frequency table of <input file> in lexicographical order
--substitute=<oldWord>+<newWord> Substitutes every occurance of <oldWord> by <newWord> in content provided by <input file>
--remove=<word> Removes every occurance of <word> in content provided by <input file>