Answer
a.
NUMBER = (771) 921-5281
i$\ \ \ \ \ $Operation$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $ Found
1$\ \ \ \ $Compare (771) 921-5281 to $T_{1}$, (648) 555-1285. No match.$\ \ \ \ \ \ \ $ No
2$\ \ \ \ $Compare (771) 921-5281 to $T_{2}$, (247) 834-6543. No match.$\ \ \ \ \ \ \ $ No
3$\ \ \ \ $Compare (771) 921-5281 to $T_{3}$, (771) 921-5281. Match.$\ \ \ \ $$\ \ \ \ \ \ \ \ $ Yes
Output = Adams
---
b.
NUMBER = (488) 351-1673
i$\ \ \ \ \ $Operation$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ $Found
1$\ \ \ \ $Compare (488) 351-1673 to $T_{1}$, (648) 555-1285. No match.$\ \ \ \ \ \ $ No
2$\ \ \ \ $Compare (488) 351-1673 to $T_{2}$, (247) 834-6543. No match.$\ \ \ \ \ \ $ No
3$\ \ \ \ $Compare (488) 351-1673 to $T_{3}$, (771) 921-5281. No match.$\ \ \ \ \ \ $ No
4$\ \ \ \ $Compare (488) 351-1673 to $T_{4}$, (356) 327-8900. No match.$\ \ \ \ \ \ $ No
Output = ‘Sorry, this number is not in the directory’
Work Step by Step
a.
NUMBER = (771) 921-5281
i$\ \ \ \ \ $Operation$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $ Found
1$\ \ \ \ $Compare (771) 921-5281 to $T_{1}$, (648) 555-1285. No match.$\ \ \ \ \ \ \ $ No
2$\ \ \ \ $Compare (771) 921-5281 to $T_{2}$, (247) 834-6543. No match.$\ \ \ \ \ \ \ $ No
3$\ \ \ \ $Compare (771) 921-5281 to $T_{3}$, (771) 921-5281. Match.$\ \ \ \ $$\ \ \ \ \ \ \ \ $ Yes
Output = Adams
---
b.
NUMBER = (488) 351-1673
i$\ \ \ \ \ $Operation$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ $Found
1$\ \ \ \ $Compare (488) 351-1673 to $T_{1}$, (648) 555-1285. No match.$\ \ \ \ \ \ $ No
2$\ \ \ \ $Compare (488) 351-1673 to $T_{2}$, (247) 834-6543. No match.$\ \ \ \ \ \ $ No
3$\ \ \ \ $Compare (488) 351-1673 to $T_{3}$, (771) 921-5281. No match.$\ \ \ \ \ \ $ No
4$\ \ \ \ $Compare (488) 351-1673 to $T_{4}$, (356) 327-8900. No match.$\ \ \ \ \ \ $ No
Output = ‘Sorry, this number is not in the directory’