A telephone company charges to cents per minutefor all calls outside the customers area code that last over 20 minutes .All other calls are 13 percents minute.Fields for each call include customer area code (three digits),customer phone number (seven digits),called area code (three digits),called number(seven digits)and called time in minutes(four digits).Display the customer area code,customer phone number,called area code,called number,called time in minutes and the total charge.Draw the flowchart for this program.
The correct answer and explanation is :
The problem involves creating a program to calculate the charge for a phone call based on certain rules set by the telephone company. To solve this, the program should consider the following:
- Customer Area Code: The customer’s area code (3 digits).
- Customer Phone Number: The customer’s phone number (7 digits).
- Called Area Code: The area code of the number being called (3 digits).
- Called Number: The called phone number (7 digits).
- Called Time in Minutes: The duration of the call in minutes (4 digits).
Charge Calculation Rule:
- Calls outside the customer’s area code that last more than 20 minutes are charged at a rate of two cents per minute.
- Calls that either are within the customer’s area code or last 20 minutes or less are charged 13 cents per minute.
The program will:
- Accept the call data as input.
- Check if the call is outside the customer’s area code and if the call lasts longer than 20 minutes.
- Apply the appropriate charge based on the rules.
- Output the customer area code, customer phone number, called area code, called number, called time in minutes, and the total charge.
Explanation:
- Input Data: We start by gathering the data required for the customer and the call.
- Conditional Logic: The program checks if the called area code differs from the customer’s area code, and if the call lasts more than 20 minutes. If both conditions are true, the charge is calculated at 2 cents per minute; otherwise, it’s 13 cents per minute.
- Output: Finally, the program outputs the customer’s details, call details, and the total charge for that particular call.
Flowchart Explanation:
- The flowchart starts with the input of the customer’s data.
- Then, it checks the conditions (if the area codes are different and the call time exceeds 20 minutes).
- Based on the result, it calculates the charge.
- The final output is displayed, showing the necessary details.

Here is the flowchart for the telephone company billing system. It visually represents the decision-making process and the steps involved in calculating the call charges based on the area code and the call duration.