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.

The Correct Answer and Explanation is:


Problem Breakdown

We are given:

  • Charging Rules:
    • 2 cents per minute for calls over 20 minutes and outside the customer’s area code.
    • 13 cents per minute for all other calls.
  • Inputs (Fields per Call):
    • Customer Area Code (3 digits)
    • Customer Phone Number (7 digits)
    • Called Area Code (3 digits)
    • Called Number (7 digits)
    • Call Duration in Minutes (up to 4 digits)
  • Output:
    • Customer Area Code
    • Customer Phone Number
    • Called Area Code
    • Called Number
    • Call Duration
    • Total Charge

Explanation

To solve this problem, we must calculate call charges based on duration and area codes. If a call lasts more than 20 minutes and is made outside the customer’s area code, the rate is 2 cents per minute. Otherwise, it is 13 cents per minute. We must collect relevant input fields, apply the correct condition, calculate the cost, and display all information.

Step-by-Step Logic:

  1. Input all data fields:
    • Customer area code and phone number
    • Called area code and phone number
    • Call duration (in minutes)
  2. Decision Making:
    • If the call duration is greater than 20 minutes AND the area codes differ, apply 2 cents/min.
    • Else, apply 13 cents/min.
  3. Calculate the charge by multiplying rate by duration.
  4. Output all details along with the computed total charge.

This simple decision-based process is well suited to a flowchart. The flowchart uses standard symbols: parallelograms for input/output, rectangles for processes, and diamonds for decisions.

This kind of logic is commonly used in billing systems and helps ensure fairness and transparency in pricing. Proper validation and branching allow for efficient charge calculation and data processing.


🔄 Flowchart Design

Here’s the correct answer with a charge chart based on the telephone company billing rules:


Correct Logic Summary

  • Charge =
    • 2 cents per minute if call duration > 20 minutes AND the call is outside the customer’s area code
    • Else: 13 cents per minute

📊 Charge Calculation Chart

Customer Area CodeCustomer PhoneCalled Area CodeCalled PhoneCall Duration (min)Rate Applied (¢/min)Total Charge (¢)
1234567890987654321025250
123456789012365432103013390
456123456778932109871813234
7892345678123765432145290
321789012332145678901513195

🔎 Explanation

  • Row 1: 25 minutes and different area code → 2¢ × 25 = 50¢
  • Row 2: 30 minutes but same area code → 13¢ × 30 = 390¢
  • Row 3: Only 18 minutes → 13¢ × 18 = 234¢ (short call)
  • Row 4: 45 minutes, different area code → 2¢ × 45 = 90¢
  • Row 5: 15 minutes, same area code → 13¢ × 15 = 195¢

This chart helps visualize how different calls are billed under the given rules.

Scroll to Top