Write a pseudo code, Features and represent the information on a flow chart which reads units of electricity and usage type to calculate the electricity bill.
Bill=units*rate
Unit used (u) | Residential rate | Commercial rate |
0 < units <= 200 | 0.8 | 0.6 |
200 < units <= 999 | 0.7 | 0.3 |
Above 999 | 0.5 | 0.2 |
Read a units
Read a usage type
IF usage_type equal “Residential”
IF units >0and units <=200 THEN
Bill= units*0.8
ELSE IF units >200 and units <=999 THEN
Bill= units*0.7
ELSE
Bill= units*0.5
END IF
END IF
ELSE
IF units >0and units <=200 THEN
Bill= units*0.6
ELSE IF units >200 and units <=999 THEN
Bill= units*0.3
ELSE
Bill= units*0.2
END IF
END IF
END IF