Previous Next
0 / 15
Module DEMO-33-65DEMO-OOP-33

Electricity Tier Bill

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read consumed electricity units and print the bill using the required tier rules.

Input Format

Input is given as whitespace-separated tokens in this order:

  1. consumed units

Output Format

Print the exact report in this order:

  1. Bill

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
80
Bill: 40.00
Input: consumed units = 80.
Key calculation(s): double bill | if (80 <= 100) { | "Bill: " + String.format("%.2f", bill) = "Bill: 40.00".
Output:
Bill: 40.00
Sample #2
Public sample
250
Bill: 162.50
Input: consumed units = 250.
Key calculation(s): double bill | if (250 <= 100) { | "Bill: " + String.format("%.2f", bill) = "Bill: 162.50".
Output:
Bill: 162.50

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings