The city charges electricity in tiers: the first 200 kWh at 0.55 yuan, the next 200 kWh at 0.60, and everything above 400 kWh at 0.85. Write ElectricityBill: read the monthly usage and print
Usage: 450 kWh (Tier 3)
Bill: 272.50 yuan
Tip: you are in the most expensive tier
A negative reading prints Invalid reading. The tip line appears only above 400 kWh. Use the conditional operator ?: for the tier name.