Ds Practical 7
Ds Practical 7
#include <iostream>
#include <unordered_map>
#include <string>
class TelephoneBook {
private:
public:
phoneBook[name] = phoneNumber;
cout << "Inserted: " << name << " → " << phoneNumber << endl;
if (phoneBook.find(name) != phoneBook.end()) {
cout << "Found: " << name << " → " << phoneBook[name] << endl;
} else {
cout << "Client '" << name << "' not found.\n";
void displayAll() {
};
int main() {
TelephoneBook book;
book.insertClient("Alice", "123-456-7890");
book.insertClient("Bob", "987-654-3210");
book.insertClient("Charlie", "555-555-5555");
book.searchClient("Bob");
book.searchClient("David");
book.displayAll();
return 0;
Output:-