DB lab2 main.cpp redesigned