(Telephony) In a directly connected telephone network, all telephones are connected and don’t…
(Telephony) In a directly connected telephone network, all telephones are connected and don’t require a central switching station to establish calls between two telephones. The number of lines needed to maintain a directly connected network for n telephones is given by this formula:
For example, directly connecting four telephones requires six separate lines (see Figure 2.15). Adding a fifth telephone to this network requires an additional 4 lines for a total of 10 lines.
a. Using the given formula, write a C++ program that determines the number of lines required for directly connecting 100 telephones. The input for this problem is the number of telephones, denoted as n in the formula, and the output is the total number of lines required to directly connect the input number of telephones.
b. Compile and run the program written for Exercise 3a.