Q42Comprehension3 Marks16 Jul 2023
Passage
Based on the above data, answer the given subquestions.
The SouthCo Electricity Board charges consumers according to the number of units consumed by them per month. However, the amount is to be paid quarterly in advance as per the tariff.
For instance, suppose a consumer has consumed 30 units. He/she has to pay Rs 2 per unit, i.e. Rs 60. If a consumer has consumed 60 units, he/she has to pay Rs 2 per unit for the first 50 units and Rs 3 per unit for the remaining units, so the total amount is Rs 100 + Rs 30 = Rs 130.

Let `unit` be the number of units consumed by the consumer and `cost` be the amount of the bill to be paid. Choose the correct implementation to compute the cost.