Skip to content

Daffyllas/Electricity-Bill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Electricity Bill Calculator (Java)

A simple Java console application that calculates the total electricity bill based on energy consumption (kWh) and customer type (residential or commercial).

This project was created to practice Java fundamentals, including user input, loops, conditionals, and basic calculations.


Pricing System

Electricity cost is calculated using a tiered pricing model:

  • 0 – 250 kWh → €0.10 per kWh
  • 251 – 500 kWh → €0.12 per kWh
  • 500+ kWh → €0.15 per kWh

Fixed Charges

  • Residential → €5
  • Commercial → €12

Features

  • User input validation (only accepts valid numbers)
  • Tier-based electricity pricing
  • Supports two customer types:
    • Residential
    • Commercial
  • Detailed price breakdown:
    • Fixed cost
    • Cost per tier
  • Prevents invalid inputs (negative or zero values)

About

Check the cost of your electricity

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages