Calculate Phone Bill
This problem is based on a simple monthly phone bill. A customer already has a base plan fee, but extra minutes add extra cost on top of that.
You are given the base fee, the number of extra minutes, and the cost for each extra minute. Your task is to calculate the final amount to pay.
For example, if the base fee is 20, the extra minutes are 5, and each extra minute costs 2, the answer is 30. That is because the extra part costs 10, and 20 + 10 = 30.
So the task is to calculate the extra charge and add it to the base fee.
Example Input & Output
The extra cost is 4, so the total becomes 14.
With no extra minutes, the final bill stays the same as the base fee.
The extra 5 minutes cost 10, so the final bill becomes 30.
Algorithm Flow

Solution Approach
A simple way to solve this is to break the bill into two parts: the base cost and the extra cost.
First, calculate how much the extra minutes cost in total. You can do that by multiplying the extra minute count by the cost per minute.
The formula is:
After that, add the extra cost to the base fee.
The final update is:
Once you have that value, print it as the answer.
The whole idea is straightforward multiplication followed by addition.
Best Answers
Solutions Coming Soon
Verified best solutions for this Challenge are still being analyzed and will be available soon.
Comments (0)
Join the Discussion
Share your thoughts, ask questions, or help others with this Challenge.
