Electricbill.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Administrator
*/
public class Electricbill {
public void bill(double amount,double price){
if(amount<=90 && amount>=1){
price=0.6*amount;
}
else if(amount<=150 && amount>=91){
price=0.6*90+1.1*(amount-90);
}
else if(amount>150){
price=0.6*90+1.1*60+1.7*(amount-150);
}
else{
System.out.println("the eletricbill is not right!");
}
System.out.printf("the eletricbill is :%5.2f ",price);
}
}
Person.java
import java.util.Scanner;
/*
* To change this template, choose