Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

2 Visitor Messages

  1. import java.util.*;
    public class Mymain
    {
    public static void main(String[] args)
    {
    Electricbill E=new Electricbill();
    Scanner s2=new Scanner(System.in);
    System.out.println("######___WELCOME T0 American Electric Bill Company___#######");
    System.out.println("Please enter the Detail: Press 1");
    int n=s2.nextInt();
    if(n==1)
    {
    System.out.println("Enter the Account Number:");
    E.Acno=s2.nextDouble();
    System.out.println("Enter the Accout tyep: 1.Residental 2.Business");
    E.type=s2.next();
    if(E.type=="Residental")
    E.Residental();
    else
    E.Business();
    }
    System.out.println("&&&&***Thank You***&&&&");
    }
    }
  2. import java.util.*;
    public class Electricbill
    {
    public double Acno;
    public String type;
    public int basic;
    public int kwh;

    public void Residental()
    {
    System.out.println("######__WELCOME T0 RESIDENTAL ACCOUNT TYPE__######");
    System.out.println("The Basic servise charges of residental is 100$");
    basic=100;
    Scanner s=new Scanner(System.in);
    System.out.println("Please enter the Kilo watt hour");
    kwh=s.nextInt();
    double a=kwh/basic;
    double total=0;
    total=a+1+10;
    if(total>3000)
    {
    total=total+100;
    System.out.println("The total bill of the customer is" +total);
    }
    else if(total>5000)
    {
    total=total+500;
    System.out.println("The total bill of the customer is" +total);
    }
    else
    {
    System.out.println("The total bill of the customer is" +total);
    }
    }
    public void Business()
    {
    System.out.println("######__WELCOME TO BUSINESS ACCOUNT TYPE__######");
    System.out.println("The Basic servise charges of Business tyep is 300$");
    basic=300;
    Scanner s1=new Scanner(System.in);
    System.out.println("Please enter the Kilo watt hour");
    kwh=s1.nextInt();
    double b=kwh/basic;
    double tutol=0;
    tutol=b+450+10;
    if(tutol>3000)
    {
    tutol=tutol+100;
    System.out.println("The total bill of the customer is:" +tutol);
    }
    else if(tutol>5000)
    {
    tutol=tutol+500;
    System.out.println("The total bill of the customer is:" +tutol);
    }
    else
    {
    System.out.println("The total bill of the customer is " +tutol);
    }
    }
    }
Showing Visitor Messages 1 to 2 of 2
About RABNAWAZ

Basic Information

About RABNAWAZ
Location:
Pakistan
Interests:
programming
Java Skill Level:
Intermediate

Statistics


Total Posts
Total Posts
2
Posts Per Day
0.00
Visitor Messages
Total Messages
2
Most Recent Message
August 18th, 2013 04:27 AM
Total Thanks
Total Thanks
0
  • Thanked 0 Times in 0 Posts
General Information
Last Activity
September 9th, 2014 01:57 PM
Join Date
August 17th, 2013