A telephone company charges to cents per minutefor all calls outside the customers area code that last over 20 minutes

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.

Here’s a complete answer to your question, including:

  1. Flowchart
  2. Correct explanation
  3. Detailed 300-word explanation

Flowchart Description

We’ll outline the flowchart steps below since image drawing needs a separate action. The logic flow is as follows:


Flowchart Steps

  1. Start
  2. Input: Customer Area Code, Customer Phone Number, Called Area Code, Called Number, Call Duration (Minutes)
  3. Is Called Area Code ≠ Customer Area Code?
    • If No → Charge = 0 → Go to Display
    • If Yes → Proceed to next check
  4. Is Call Duration > 20?
    • If No → Charge = 0 → Go to Display
    • If Yes → Charge = Call Duration × 2 cents
  5. Display: Customer Area Code, Customer Phone Number, Called Area Code, Called Number, Call Duration, Total Charge
  6. End

Explanation

This program calculates long-distance telephone call charges for a customer based on the area code and duration of the call. The charge only applies when the called area code is different from the customer’s area code, and the call lasts more than 20 minutes. Otherwise, the call is free.

First, the program prompts the user to input the required data: the customer’s area code and phone number, the called area code and number, and the duration of the call in minutes. The input values help determine whether the call qualifies as billable.

The logic begins by comparing the customer’s area code with the called area code. If they are the same, the call is local, and no charge applies, regardless of its duration.

If the area codes are different, the program then checks the duration of the call. If the call is less than or equal to 20 minutes, it is not billed. If it exceeds 20 minutes, the call is billed at 2 cents per minute for the entire duration.

This billing rule ensures that only longer-distance calls over 20 minutes are charged, encouraging short conversations or local communication. Once the billing logic is complete, the program displays all relevant call details, including both area codes, phone numbers, duration, and the calculated total charge.

The flowchart follows this conditional logic precisely, ensuring that calls are only charged under the correct circumstances. This kind of system can be useful for generating monthly bills or for real-time charge estimation in a telecom system.


Scroll to Top