Problem

(Modify) Modify the program you wrote for Exercise and include a new variable to represent...

(Modify) Modify the program you wrote for Exercise and include a new variable to represent the additional number of telephones to be connected to an existing network, and initialize this variable to 10. For this program, two outputs are required: the number of direct lines for 100 telephones and the additional number of lines needed when 10 telephones are added to the existing network.

Exercise:

(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:

no. of lines needed =

For example, directly connecting four telephones requires six separate lines (see Figure). 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 a.

Figure: Directly connecting four telephones

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 2.6
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT