36 lines
726 B
C++
36 lines
726 B
C++
# include <iostream>
|
|
# include <iomanip>
|
|
# include <string>
|
|
#include "PhoneBook.hpp"
|
|
|
|
int main()
|
|
{
|
|
std::string command;
|
|
PhoneBook phoneBook;
|
|
|
|
while (42)
|
|
{
|
|
std::cout << "Enter a command > ";
|
|
if (!std::getline(std::cin, command))
|
|
{
|
|
std::cout << "\nBye!" << std::endl;
|
|
break;
|
|
}
|
|
else if (command == "ADD")
|
|
{
|
|
phoneBook.addContact();
|
|
}
|
|
else if (command == "SEARCH")
|
|
{
|
|
phoneBook.searchContacts();
|
|
}
|
|
else if (command == "EXIT")
|
|
{
|
|
std::cout << "EXIT" << std::endl;
|
|
break;
|
|
}
|
|
else
|
|
std::cout << "Invalid command. Please use ADD, SEARCH, or EXIT." << std::endl;
|
|
}
|
|
return 0;
|
|
} |