184k views
0 votes
8. A programmer wrote an essay for his history class, and realized he has confused the names of Benjamin Franklin and Alexander Graham Bell. Instead of going through the whole paper and changing the names, he used the following incorrect algorithm in an attempt replace every occurrence of "Benjamin Franklin" with "Alexander Graham Bell" and vise versa:

First, change all occurrences of "Benjamin Franklin" to "apple"
Then, change all occurrences of "apple" to "Alexander Graham Bell".
Then, change all occurrences of "Alexander Graham Bell" to "Benjamin Franklin".
Here is an example of one of the sentences from the paper:
Alexander Graham Bell was born 141 years before Benjamin Franklin, so he was never able to telephone his neighbors.
Which of the following is the result of running the described incorrect algorithm on the sentence above?
A. Benjamin Franklin was born 141 years before Alexander Graham Bell, so he was never able to telephone his neighbors.
B. apple was born 141 years before Benjamin Franklin, so he was never able to telephone his neighbors.
C. Alexander Graham Bell was born 141 years before apple, so he was never able to telephone his neighbors.
D. Benjamin Franklin was born 141 years before Benjamin Franklin, so he was never able to telephone his neighbors.
E. Alexander Graham Bell was born 141 years before Alexander Graham Bell, so he was never able to telephone his neighbors.

1 Answer

1 vote

Answer:

E. Alexander Graham Bell was born 141 years before Alexander Graham Bell, so he was never able to telephone his neighbors.

Step-by-step explanation:

Because in the end all names would be changed Alexander Graham Bell.

User Emmanuel Dupuy
by
5.5k points