Home Java Electricity Bill Calculation using Java Application

# Electricity Bill Calculation using Java Application

0
194

This tutorils teach Electricity Bill Calculating based on the below conditions step by step

1. First 100 units: \$0.10 per unit
2. Next 200 units (101 to 300): \$0.15 per unit
3. Above 300 units: \$0.20 per unit

This is code of the project

```private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
{
int unitcal = Integer.parseInt(txtUnit.getText());
double totalbill = calBill(unitcal);
txtBill.setText(String.format(" \$%.2f", totalbill));
}

int units;
private static double calBill(int units)
{
double totbill = 0.0;

if(units <= 100)
{
totbill = units * 0.10;
}
else if(units <= 300)
{
totbill = 100 * 0.10 + (units -100) * 0.15;
}
else
{
totbill = 100 * 0.10 +  200 * 0.15 + (units -300) * 0.25;
}
}```

• ### Banking Loan Calculation Project using Java

This tutorials series we are going to talk about how to make a banking loan calculation pr…
• ### Banking Deposit Amount Calculation in Java

In this tutorials will teach Banking Deposit Amount Calculation in Java following these co…
• ### BeerShop Inventory Management System using Java

This tutorial will teach you how to make a Beer Shop Inventory Management System in Java s…
• ### Form Repeater using HTML CSS JQuery

In this tutorial we are going to teach Form Repeater using HTML CSS JQuery.step by step.th…
• ### AJAX CRUD Application in Laravel 11

Introduction to AJAX and Laravel 11 AJAX, which stands for Asynchronous JavaScript and XML…
• ### Java Banking Project: Accurate FD Rate Calculation Tutorial

Introduction to FD Rate Calculation In any banking project, accurately calculating Fixed D…
• ### Banking Application FD Rate Calculation using Java

In this tutorials i am to teach Banking Application FD Rate Calculation using Java. Input …
• ### Banking Loan Calculation Project using Java

This tutorials series we are going to talk about how to make a banking loan calculation pr…