Results 1 to 3 of 3
  1. #1
    Rabrahs is offline Member
    Join Date
    Jan 2017
    Ghana West Africa
    Rep Power

    Post Electricity bill java program

    Hi, I'm new to programming and I've chosen to start with Java. So for i understand what a class, method and input and output
    streams are and how they are used. I'm trying to write a program to bill customers electricity usage, below is how the program should be.

    A java application program to bill customers. With the following information

    1-We have two types of customers
    a-Residential customers
    b-Business customers

    2-The billing process(Residential Users)
    i- Bill-processing fee: $4.50
    ii- Basic service fee: $10.50
    iii- Premium (points): $5.00 per point

    For Business
    i- Bill-processing fee: $15.00
    ii- Basic service: $75.00 for the first 10 points,
    $5.00 for additional points

    Your program should ask the user for an account number(integer)
    and a customer code.

    input to your program should be customer's account number, customer code
    number of premium points customer subscribed and in the case of business customer,
    the number of basic service points

    Customer's account number and the billing amount.

    So far this is what i was able to start with

    Java Code:
    import java.util.*;
    public class ElectricBill {
    	static Scanner console = new Scanner(;
    	public static void main(String[] args) {
        int cust_account_num;
        int cust_code;
    System.out.println("Enter Your account number");
    cust_account_num = console.nextInt();
    System.out.println("Enter Your account code");
    cust_code = console.nextInt();

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power

    Default Re: Electricity bill java program

    I move the thread to the New section.

    Do you have any specific java programming questions?

    Note: Properly formatted code is easier to read and understand. Try to get the {}s aligned and the nested statements properly indented.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    cronnin is offline Member
    Join Date
    Jan 2017
    Rep Power

    Default Re: Electricity bill java program

    As I understand an operator is supposed to input customer data and get back it's bill?
    Where from did you plan to take the billing data from? Some array, XML, database?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts